loader_4th: scan_buffer can leave empty string on stack

When the file processing is done, we will have string with lenght 0 in stack and we will attempt to
allocate 0 bytes.
This commit is contained in:
Toomas Soome 2019-09-16 20:26:53 +00:00
parent 320c848ff6
commit 1781ad707e

View File

@ -363,6 +363,7 @@ variable fd
;
: line_buffer_resize ( len -- len )
dup 0= if exit then
>r
line_buffer .len @ if
line_buffer .addr @
@ -376,6 +377,7 @@ variable fd
;
: append_to_line_buffer ( addr len -- )
dup 0= if 2drop exit then
line_buffer strget
2swap strcat
line_buffer .len !