diff options
author | B. Watson <urchlay@slackware.uk> | 2024-07-14 03:00:52 -0400 |
---|---|---|
committer | B. Watson <urchlay@slackware.uk> | 2024-07-14 03:00:52 -0400 |
commit | 7d62e61608a8c54edc46eb5702287af84b045c69 (patch) | |
tree | 2b68d6de20fee64fe7408b271995f3720b43602a | |
parent | dfc8edb273235c2494bad0d119990b2981978cbb (diff) | |
download | bw-atari8-tools-7d62e61608a8c54edc46eb5702287af84b045c69.tar.gz |
add sanity checking to BASIC header, in parse_header().
-rw-r--r-- | bas.c | 8 | ||||
-rw-r--r-- | listbas.1 | 1 | ||||
-rw-r--r-- | listbas.rst | 1 |
3 files changed, 8 insertions, 2 deletions
@@ -115,13 +115,17 @@ void parse_header(void) { vvstart = vvtp - TBL_OFFSET; code_end = starp - TBL_OFFSET; - if(lomem) die("This doesn't look like an Atari BASIC program (no $0000 signature)."); - if(filelen < code_end) { fprintf(stderr, "Warning: file is truncated: %d bytes, should be %d.\n", filelen, code_end); } if(verbose) dump_header_vars(); + + /* these checks are actually kind of conservative. */ + if(lomem) die("Not an Atari BASIC program (no $0000 signature)."); + if(vntp < 0x100) die("Not an Atari BASIC program (invalid VNTP)."); + if(vvtp < vntd) die("Not an Atari BASIC program (invalid VVTP)."); + if(starp < vvtp) die("Not an Atari BASIC program (invalid STARP)."); } void update_header(void) { @@ -220,6 +220,7 @@ looks very similar to how it would appear on the Atari. \fBlistbas\fP does color syntax highlighting. .IP \(bu 2 \fBlistbas\fP only supports Atari BASIC, not Turbo BASIC or BASIC XL/XE. +This is a bug, not a feature... .IP \(bu 2 \fBlistbas\fP doesn\(aqt show information about the variables. Use \fBvxrefbas\fP(1) for that. diff --git a/listbas.rst b/listbas.rst index 46a44a4..63eb575 100644 --- a/listbas.rst +++ b/listbas.rst @@ -188,6 +188,7 @@ protection. - **listbas** does color syntax highlighting. - **listbas** only supports Atari BASIC, not Turbo BASIC or BASIC XL/XE. + This is a bug, not a feature... - **listbas** doesn't show information about the variables. Use **vxrefbas**\(1) for that. |