examples: Silence warnings about return value of fwrite()
authorPeter Stuge <peter@stuge.se>
Sat, 16 Oct 2010 12:22:30 +0000 (14:22 +0200)
committerPeter Stuge <peter@stuge.se>
Sat, 16 Oct 2010 12:22:30 +0000 (14:22 +0200)
examples/dpfp.c
examples/dpfp_threaded.c

index af51e0f..a35a373 100644 (file)
@@ -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;
index 4641a50..7b98192 100644 (file)
@@ -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;