From aa2c841fd291ba062881534936b7d89674b5f52d Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Tue, 25 Jun 2024 04:09:15 -0400 Subject: bas.c: terminate walk_code() loop correctly. --- bas.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) { -- cgit v1.2.3