Skip to content
Commit 83c675ac authored by David Oberhollenzer's avatar David Oberhollenzer
Browse files

mtd-utils: Fix "are we really at EOF" test logic in libubi read_data



The function reads file data into a buffer and then checks if we
actually are at the end-of-file by trying to read one more byte.
For whatever reason, the code uses an int instead of a char. It's
not pretty but works. But again, this is something that every
static analysis tool barks at.

Further more, the error messages are inverted. "We aren't at EOF yet"
is printed on failure and something like "read error %m" is printed
on success.

This patch fixes all of the above.

Signed-off-by: default avatarDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>
parent 7d40c1a1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment