fixed a bug

This commit is contained in:
Koichi Nakamura 2021-01-08 04:28:53 +09:00
parent 9608f4f540
commit 6b6a2ed057

View file

@ -1159,7 +1159,7 @@ decimal \ set default to decimal
; ;
\ Allocate a buffer for string literal \ Allocate a buffer for string literal
bl constant s-buffer-size \ 1024 bl bl * constant s-buffer-size \ 1024
create s-buffer s-buffer-size allot drop create s-buffer s-buffer-size allot drop
\ Will define the error message corresponds to this error later \ Will define the error message corresponds to this error later
@ -1185,8 +1185,9 @@ char 0 char B - constant STRING-OVERFLOW-ERROR \ -18
else else
s-buffer dup \ save start address s-buffer dup \ save start address
begin key dup '"' <> while begin key dup '"' <> while
2dup swap - s-buffer-size >= if ( buf pos c pos-buf )
throw STRING-OVERFLOW-ERROR over 3 pick - s-buffer-size 1- >= if
STRING-OVERFLOW-ERROR throw
then then
over c! \ store char over c! \ store char
1+ \ increment address 1+ \ increment address