Skip to content

Commit 9a5fe11

Browse files
committed
Fix bug in token_get
code was not being set to NULL when reaching end of the string due to incorrect checking of character at current position instead of the next position.
1 parent 6b2d267 commit 9a5fe11

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

parse.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,8 @@ struct Token token_get(char *code, char **next) {
236236
if (next_code) {
237237
*next = *next_code == '\0' ? NULL : next_code;
238238
} else {
239-
*next = *code == '\0' ? NULL : code + token.data_len;
239+
code += token.data_len;
240+
*next = *code == '\0' ? NULL : code;
240241
}
241242

242243
// Return the token

0 commit comments

Comments
 (0)