aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2024-06-25 04:09:15 -0400
committerB. Watson <urchlay@slackware.uk>2024-06-25 04:09:15 -0400
commitaa2c841fd291ba062881534936b7d89674b5f52d (patch)
tree57689fb19bdda84f7946db32cb1d71a68e8b5ff2
parentca7575363e8517c0d409eed2641ed2ba6a523141 (diff)
downloadbw-atari8-tools-aa2c841fd291ba062881534936b7d89674b5f52d.tar.gz
bas.c: terminate walk_code() loop correctly.
-rw-r--r--bas.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/bas.c b/bas.c
index 8b62837..efb985e 100644
--- a/bas.c
+++ b/bas.c
@@ -306,6 +306,8 @@ void walk_code(unsigned int startlineno, unsigned int endlineno) {
continue;
}
+ if(lineno > endlineno) break;
+
CALL(on_start_line);
pos = linepos + 3;
@@ -362,7 +364,7 @@ void walk_code(unsigned int startlineno, unsigned int endlineno) {
CALL(on_end_line);
linepos = nextpos;
- if(lineno >= endlineno) break;
+ if(lineno == 32768) break;
}
if(endlineno == 32768 && linepos < filelen) {