From: simon 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://git.distorted.org.uk/~mdw/sgt/puzzles/commitdiff_plain/29797015e2425b779af5858b4bac2ff5e3aaee3b Don't ignore the return code of fwrite(). (Slight modification of a patch from Phil Bordelon.) git-svn-id: svn://svn.tartarus.org/sgt/puzzles@8373 cda61777-01e9-0310-a592-d414129be87e --- 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++)