diff options
author | Christian Hesse <mail@eworm.de> | 2014-02-25 19:13:58 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2014-02-25 19:13:58 +0100 |
commit | 94a895c1fa19dfd3c3fcea8538a80fe318db923c (patch) | |
tree | c54d3f48b8a3bc79bfeb6e20baefe2cabada79fb | |
parent | 33f24c0c7f9119e357da148ec6732832ee48ab3f (diff) | |
download | cqrlogo-94a895c1fa19dfd3c3fcea8538a80fe318db923c.tar.gz cqrlogo-94a895c1fa19dfd3c3fcea8538a80fe318db923c.tar.zst |
check fwrite return value
-rw-r--r-- | cqrlogo.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -104,7 +104,10 @@ int main(int argc, char **argv) { } /* write PNG data to stdout */ - fwrite(png->buffer, png->size, 1, stdout); + if (fwrite(png->buffer, png->size, 1, stdout) != 1) { + fprintf(stderr, "Failed writing PNG data to stdout.\n"); + return EXIT_FAILURE; + } /* free memory we no longer need */ if (uri_server_name) |