firmware-utils: mkdlinkfw: fix error handling
authorMathias Kresin <dev@kresin.me>
Sat, 5 Jan 2019 06:40:55 +0000 (07:40 +0100)
committerMathias Kresin <dev@kresin.me>
Sun, 13 Jan 2019 17:31:10 +0000 (18:31 +0100)
commit0e78af22d95d91f7c2fdfc66fac993c6c5d349d8
tree64f827000c8d815e44291ec69f46e5a6af9faaef
parente428b127e7c9964a20cfd4cfb30b43262a10bfbe
firmware-utils: mkdlinkfw: fix error handling

fread() doesn't set errno, ferror need to be used to check for errors.
While at it, check if we read the expect number of elements.

Signed-off-by: Mathias Kresin <dev@kresin.me>
tools/firmware-utils/src/mkdlinkfw-lib.c