aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--unprotbas.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/unprotbas.c b/unprotbas.c
index d7ca847..a4a2129 100644
--- a/unprotbas.c
+++ b/unprotbas.c
@@ -113,6 +113,10 @@ void die(const char *msg) {
int readfile(void) {
int got = fread(data, 1, BUFSIZE - 1, input_file);
if(verbose) fprintf(stderr, "Read %d bytes.\n", got);
+ if(!feof(input_file))
+ fprintf(stderr, "Warning: file is >64KB, way too big for a BASIC program.\n");
+ else if(got > 38176)
+ fprintf(stderr, "Warning: file is %d bytes, suspiciously large for a BASIC program.\n", got);
fclose(input_file);
if(got < MIN_PROG_SIZE)
die("File too short to be a BASIC program (truncated?)\n");