diff options
author | B. Watson <urchlay@slackware.uk> | 2024-07-14 03:25:11 -0400 |
---|---|---|
committer | B. Watson <urchlay@slackware.uk> | 2024-07-15 15:36:22 -0400 |
commit | a13e921b196a2be691af256520877e4020a04f0c (patch) | |
tree | cdf75c2b9f0b6e3e8f23af90007c48eb6928f339 | |
parent | 56276edbe7381d19319f7390719298f7f93471e1 (diff) | |
download | bw-atari8-tools-a13e921b196a2be691af256520877e4020a04f0c.tar.gz |
bas.c: don't allow null bytes in variable name table, except at the end.
-rw-r--r-- | bas.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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++; |