Skip to content
Snippets Groups Projects
Commit f67066b6 authored by Mike Frysinger's avatar Mike Frysinger Committed by Wolfgang Denk
Browse files

envcrc: check return value of fwrite()


Newer toolchains will often complain about unchecked fwrite():
	envcrc.c:117: warning: ignoring return value of `fwrite, declared
		with attribute warn_unused_result

So check the return value to silence the warnings.

Signed-off-by: default avatarMike Frysinger <vapier@gentoo.org>
parent efd988eb
No related branches found
No related tags found
No related merge requests found
......@@ -21,6 +21,7 @@
* MA 02111-1307 USA
*/
#include <errno.h>
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
......@@ -114,7 +115,8 @@ int main (int argc, char **argv)
}
for (i = start; i != end; i += step)
printf("%c", (crc & (0xFF << (i * 8))) >> (i * 8));
fwrite(dataptr, 1, datasize, stdout);
if (fwrite(dataptr, 1, datasize, stdout) != datasize)
fprintf(stderr, "fwrite() failed: %s\n", strerror(errno));
} else {
printf("CRC32 from offset %08X to %08X of environment = %08X\n",
(unsigned int) (dataptr - envptr),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment