Ensure negative numbers are handled properly

This commit is contained in:
2023-07-01 15:12:21 +01:00
parent e818135aef
commit 135a6da54c
2 changed files with 11 additions and 11 deletions

View File

@@ -639,7 +639,7 @@ lexer_state_t handle_key(lexer_t *lexer, char input) {
lexer_state_t handle_value(lexer_t *lexer, char input) {
if (isspace(input)) {
return LEXER_STATE_VALUE;
} else if (isdigit(input) && input != '0') {
} else if ((isdigit(input) && input != '0') || input == '-') {
dstr_append(&(lexer->current_string), input);
return LEXER_STATE_NUMBER;