summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--input.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/input.c b/input.c
index 61439b3..be59386 100644
--- a/input.c
+++ b/input.c
@@ -1653,7 +1653,8 @@ paragraph *read_input(input *in, indexdata *idx) {
rewind(in->currfp);
}
if (!binary) {
- fclose(in->currfp);
+ if (in->currfp)
+ fclose(in->currfp);
in->currfp = fopen(in->filenames[in->currindex], "r");
}
}