diff options
author | Andrew Dunstan | 2024-04-05 20:07:52 +0000 |
---|---|---|
committer | Andrew Dunstan | 2024-04-05 20:08:40 +0000 |
commit | c3e60f3d7e4268c6448ec592053b3b893899867d (patch) | |
tree | c8c8ae3882026f176446d6e83c13c0715b94a96f /src/common/jsonapi.c | |
parent | 55a5ee30cd65886ff0a2e7ffef4ec2816fbec273 (diff) |
Silence some compiler warnings in commit 3311ea86ed
Per report from Nathan Bossart
Diffstat (limited to 'src/common/jsonapi.c')
-rw-r--r-- | src/common/jsonapi.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/common/jsonapi.c b/src/common/jsonapi.c index 5f947dd6182..44dbb7f7f96 100644 --- a/src/common/jsonapi.c +++ b/src/common/jsonapi.c @@ -279,6 +279,8 @@ IsValidJsonNumber(const char *str, int len) return false; dummy_lex.incremental = false; + dummy_lex.inc_state = NULL; + dummy_lex.pstack = NULL; /* * json_lex_number expects a leading '-' to have been eaten already. @@ -297,6 +299,8 @@ IsValidJsonNumber(const char *str, int len) dummy_lex.input_length = len; } + dummy_lex.token_start = dummy_lex.input; + json_lex_number(&dummy_lex, dummy_lex.input, &numeric_error, &total_len); return (!numeric_error) && (total_len == dummy_lex.input_length); @@ -2018,6 +2022,9 @@ json_lex_number(JsonLexContext *lex, char *s, { appendBinaryStringInfo(&lex->inc_state->partial_token, lex->token_start, s - lex->token_start); + if (num_err != NULL) + *num_err = error; + return JSON_INCOMPLETE; } else if (num_err != NULL) |