forked from mirrors/ubasic
fix
This commit is contained in:
parent
cc07193c23
commit
155ce36531
5 changed files with 114 additions and 18 deletions
|
|
@ -149,7 +149,10 @@ get_next_token(void)
|
|||
nextptr = ptr;
|
||||
do {
|
||||
++nextptr;
|
||||
} while(*nextptr != '"');
|
||||
} while(*nextptr != '"' && *nextptr != 0);
|
||||
if(*nextptr == 0) {
|
||||
return TOKENIZER_ERROR; /* unterminated string */
|
||||
}
|
||||
++nextptr;
|
||||
return TOKENIZER_STRING;
|
||||
} else {
|
||||
|
|
@ -240,8 +243,8 @@ tokenizer_string(char *dest, int len)
|
|||
return;
|
||||
}
|
||||
string_len = string_end - ptr - 1;
|
||||
if(len < string_len) {
|
||||
string_len = len;
|
||||
if(len - 1 < string_len) {
|
||||
string_len = len - 1;
|
||||
}
|
||||
memcpy(dest, ptr + 1, string_len);
|
||||
dest[string_len] = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue