aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2008-12-12 19:49:05 +0000
committerSimon Tatham <anakin@pobox.com>2008-12-12 19:49:05 +0000
commit17334d19452b8818865c31bf2e42d2cf334c1f02 (patch)
treeca927e1117b5181ac384ea1444f34668024aaf61
parentba08d8ab28cb26cf3f743acf0e9c9df13bbb5d3e (diff)
downloadpuzzles-17334d19452b8818865c31bf2e42d2cf334c1f02.zip
puzzles-17334d19452b8818865c31bf2e42d2cf334c1f02.tar.gz
puzzles-17334d19452b8818865c31bf2e42d2cf334c1f02.tar.bz2
puzzles-17334d19452b8818865c31bf2e42d2cf334c1f02.tar.xz
Don't ignore the return code of fwrite(). (Slight modification of a
patch from Phil Bordelon.) [originally from svn r8373]
-rw-r--r--obfusc.c6
1 files changed, 5 insertions, 1 deletions
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++)