aboutsummaryrefslogtreecommitdiff
path: root/bas.c
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2024-07-14 03:25:11 -0400
committerB. Watson <urchlay@slackware.uk>2024-07-15 15:36:22 -0400
commita13e921b196a2be691af256520877e4020a04f0c (patch)
treecdf75c2b9f0b6e3e8f23af90007c48eb6928f339 /bas.c
parent56276edbe7381d19319f7390719298f7f93471e1 (diff)
downloadbw-atari8-tools-a13e921b196a2be691af256520877e4020a04f0c.tar.gz
bas.c: don't allow null bytes in variable name table, except at the end.
Diffstat (limited to 'bas.c')
-rw-r--r--bas.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/bas.c b/bas.c
index ab02b28..6be34f7 100644
--- a/bas.c
+++ b/bas.c
@@ -207,8 +207,9 @@ int vntable_ok(void) {
while(vp < vvstart) {
unsigned char c = program[vp];
- /* treat a null byte as end-of-table, ignore any junk between it and VNTP. */
- if(c == 0) break;
+ /* allow for (but don't require) dummy byte at VNTD. used to just
+ quit when we hit 0, but 0 might be part of a scrambled table. */
+ if(c == 0 && vp == (vvstart - 1)) break;
vp++;