From: Simon Tatham Date: Fri, 12 Dec 2008 19:49:05 +0000 (+0000) Subject: Don't ignore the return code of fwrite(). (Slight modification of a X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=17334d19452b8818865c31bf2e42d2cf334c1f02;p=sgt-puzzles.git Don't ignore the return code of fwrite(). (Slight modification of a patch from Phil Bordelon.) [originally from svn r8373] --- diff --git a/obfusc.c b/obfusc.c index 0db8aee..dc0656c 100644 --- a/obfusc.c +++ b/obfusc.c @@ -114,7 +114,11 @@ int main(int argc, char **argv) obfuscate_bitmap(data, datalen * 8, decode); if (outputmode == BINARY) { - fwrite(data, 1, datalen, stdout); + int ret = fwrite(data, 1, datalen, stdout); + if (ret < 0) { + fprintf(stderr, "obfusc: write: %s\n", strerror(errno)); + return 1; + } } else { int i; for (i = 0; i < datalen; i++)