diff options
author | B. Watson <urchlay@slackware.uk> | 2024-07-15 14:36:57 -0400 |
---|---|---|
committer | B. Watson <urchlay@slackware.uk> | 2024-07-15 15:36:39 -0400 |
commit | 4b72993e746bc654178ba80b66ed6a1f854210e1 (patch) | |
tree | 501258dbab1e42f30601d93504bbf5816921f563 | |
parent | c8a7eb85d06c71a184a7fe5aabd732d0779900cf (diff) | |
download | bw-atari8-tools-4b72993e746bc654178ba80b66ed6a1f854210e1.tar.gz |
bas.c: warn and return from walk_code() if the program ends in the middle of a line.
-rw-r--r-- | bas.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -316,6 +316,10 @@ void walk_code(unsigned int startlineno, unsigned int endlineno) { lineno = tmpno; offset = program[linepos + 2]; nextpos = linepos + offset; + if(nextpos > filelen) { + fprintf(stderr, "Warning: program truncated in the middle of line %d.\n", lineno); + return; + } end = nextpos; pos = linepos; |