aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bas.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/bas.c b/bas.c
index 7c7fa34..cf73fef 100644
--- a/bas.c
+++ b/bas.c
@@ -71,6 +71,7 @@ void readfile(void) {
else if(filelen > MAX_PROG_SIZE)
fprintf(stderr, "Warning: file is %d bytes, suspiciously large for a BASIC program.\n", filelen);
fclose(input_file);
+ input_file = NULL; /* so caller can tell it's closed */
if(filelen < MIN_PROG_SIZE)
die("File too short to be a BASIC program (truncated?)\n");
}
@@ -80,6 +81,7 @@ int writefile(void) {
outbytes = fwrite(program, 1, filelen, output_file);
fclose(output_file);
+ output_file = NULL; /* so caller can tell it's closed */
if(verbose) fprintf(stderr, "Wrote %d bytes.\n", outbytes);
return outbytes;
}