aboutsummaryrefslogtreecommitdiff
path: root/fly-tools/background/main.c
diff options
context:
space:
mode:
authormutantturkey <mutantturke@gmail.com>2012-07-05 19:13:45 -0400
committermutantturkey <mutantturke@gmail.com>2012-07-05 19:13:45 -0400
commite8ab2ebde46b4009ccaf10c6a987f214c23c37f0 (patch)
tree833fc221c26c917dcc89ebf66ddecb9722fead33 /fly-tools/background/main.c
parent4faba574ffbf531095d3c482a7829920d4a9ac11 (diff)
okay rewind won't work because at a EOF we cannot rewind
Diffstat (limited to 'fly-tools/background/main.c')
-rw-r--r--fly-tools/background/main.c6
1 files 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 ) {