diff options
-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; |