From e8ab2ebde46b4009ccaf10c6a987f214c23c37f0 Mon Sep 17 00:00:00 2001 From: mutantturkey Date: Thu, 5 Jul 2012 19:13:45 -0400 Subject: okay rewind won't work because at a EOF we cannot rewind --- fly-tools/background/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fly-tools/background/main.c b/fly-tools/background/main.c index 89ebd13..e27ff2b 100644 --- a/fly-tools/background/main.c +++ b/fly-tools/background/main.c @@ -82,7 +82,7 @@ int main(int argc, char **argv ) { printf("could not open file \n"); exit(1); } - rewind(input_file); + fclose(input_file); first_wand = NewMagickWand(); if(MagickReadImage(first_wand, filename) == MagickFalse) { @@ -97,10 +97,11 @@ int main(int argc, char **argv ) { printf("height: %d width:%d \n", height, width); // count number of images we have in the file + input_file = fopen( image_list, "r"); while((fgets(filename, sizeof(filename), input_file)) != NULL) { nImages++; } - rewind(input_file); + fclose(input_file); printf("number of images: %d \n", nImages); @@ -121,7 +122,6 @@ int main(int argc, char **argv ) { printf("error could not open input file"); exit(1); } - while ((fgets(filename, sizeof(filename), input_file)) != NULL ) { -- cgit v1.2.3