aboutsummaryrefslogtreecommitdiff
path: root/bas.c
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2024-07-05 16:38:48 -0400
committerB. Watson <urchlay@slackware.uk>2024-07-05 16:38:48 -0400
commitaf030cc065258ded70876df12c1613a5c59c7b9d (patch)
tree1edc56e535530ddf7f33c02a3788ba2e70d59284 /bas.c
parent15cedfcccd950b76673d59eb48f674b50330ac0d (diff)
downloadbw-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.
Diffstat (limited to 'bas.c')
-rw-r--r--bas.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/bas.c b/bas.c
index efb985e..13385f1 100644
--- a/bas.c
+++ b/bas.c
@@ -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;