diff options
author | B. Watson <urchlay@slackware.uk> | 2024-07-05 16:38:48 -0400 |
---|---|---|
committer | B. Watson <urchlay@slackware.uk> | 2024-07-05 16:38:48 -0400 |
commit | af030cc065258ded70876df12c1613a5c59c7b9d (patch) | |
tree | 1edc56e535530ddf7f33c02a3788ba2e70d59284 | |
parent | 15cedfcccd950b76673d59eb48f674b50330ac0d (diff) | |
download | bw-atari8-tools-af030cc065258ded70876df12c1613a5c59c7b9d.tar.gz |
bas.c: vntable_ok() no longer thinks the var name table is bad if it's only one byte long.
-rw-r--r-- | bas.c | 18 |
1 files changed, 11 insertions, 7 deletions
@@ -171,15 +171,19 @@ int vntable_ok(void) { /* first pass: bad = 1 if all the bytes in the table have the same value, no matter what it is. */ vp = vnstart + 1; - bad = 1; - while(vp < vvstart - 1) { - if(program[vp] != program[vnstart]) { - bad = 0; - break; + + /* don't do this check if the table is only one byte long! */ + if(vp < vvstart - 1) { + bad = 1; + while(vp < vvstart - 1) { + if(program[vp] != program[vnstart]) { + bad = 0; + break; + } + vp++; } - vp++; + if(bad) return 0; } - if(bad) return 0; /* 2nd pass: bad = 1 if there's any invalid character in the table. */ vp = vnstart; |