aboutsummaryrefslogtreecommitdiffstats
path: root/cqrlogo.c
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2014-02-25 19:13:58 +0100
committerGravatar Christian Hesse <mail@eworm.de>2014-02-25 19:13:58 +0100
commit94a895c1fa19dfd3c3fcea8538a80fe318db923c (patch)
treec54d3f48b8a3bc79bfeb6e20baefe2cabada79fb /cqrlogo.c
parent33f24c0c7f9119e357da148ec6732832ee48ab3f (diff)
downloadcqrlogo-94a895c1fa19dfd3c3fcea8538a80fe318db923c.tar.gz
cqrlogo-94a895c1fa19dfd3c3fcea8538a80fe318db923c.tar.zst
check fwrite return value
Diffstat (limited to 'cqrlogo.c')
-rw-r--r--cqrlogo.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/cqrlogo.c b/cqrlogo.c
index d3a9541..6153cb7 100644
--- a/cqrlogo.c
+++ b/cqrlogo.c
@@ -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)