From 678c242705b29f9cb6cc421b5625a6485ae58047 Mon Sep 17 00:00:00 2001 From: Peter Stuge Date: Sat, 16 Oct 2010 14:22:30 +0200 Subject: [PATCH] examples: Silence warnings about return value of fwrite() --- examples/dpfp.c | 3 ++- examples/dpfp_threaded.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/dpfp.c b/examples/dpfp.c index af51e0f..a35a373 100644 --- a/examples/dpfp.c +++ b/examples/dpfp.c @@ -225,6 +225,7 @@ static int save_to_file(unsigned char *data) { FILE *fd; char filename[64]; + size_t ignore; sprintf(filename, "finger%d.pgm", img_idx++); fd = fopen(filename, "w"); @@ -232,7 +233,7 @@ static int save_to_file(unsigned char *data) return -1; fputs("P5 384 289 255 ", fd); - fwrite(data + 64, 1, 384*289, fd); + ignore = fwrite(data + 64, 1, 384*289, fd); fclose(fd); printf("saved image to %s\n", filename); return 0; diff --git a/examples/dpfp_threaded.c b/examples/dpfp_threaded.c index 4641a50..7b98192 100644 --- a/examples/dpfp_threaded.c +++ b/examples/dpfp_threaded.c @@ -254,6 +254,7 @@ static int save_to_file(unsigned char *data) { FILE *fd; char filename[64]; + size_t ignore; sprintf(filename, "finger%d.pgm", img_idx++); fd = fopen(filename, "w"); @@ -261,7 +262,7 @@ static int save_to_file(unsigned char *data) return -1; fputs("P5 384 289 255 ", fd); - fwrite(data + 64, 1, 384*289, fd); + ignore = fwrite(data + 64, 1, 384*289, fd); fclose(fd); printf("saved image to %s\n", filename); return 0; -- 2.7.4