diff options
-rw-r--r-- | bas.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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; } |