aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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++;