Sun, 15 Dec 2024 15:46:51 +0100
fix wrong "variant" of zero/NULL/false
src/json.c | file | annotate | diff | comparison | revisions |
--- a/src/json.c Sun Dec 15 15:44:40 2024 +0100 +++ b/src/json.c Sun Dec 15 15:46:51 2024 +0100 @@ -100,7 +100,7 @@ allocated = true; str = cx_strcat_m(json->uncompleted.content, 1, str); if (str.ptr == NULL) { - return (CxJsonToken){CX_JSON_NO_TOKEN, false, {0, 0}}; + return (CxJsonToken){CX_JSON_NO_TOKEN, false, {NULL, 0}}; } } json->uncompleted = (CxJsonToken){0}; @@ -120,7 +120,7 @@ if (allocated) { cx_strfree(&str); } - return (CxJsonToken){CX_JSON_TOKEN_ERROR, false, {0, 0}}; + return (CxJsonToken){CX_JSON_TOKEN_ERROR, false, {NULL, 0}}; } return (CxJsonToken){ttype, allocated, str}; } @@ -184,7 +184,7 @@ } else if (ctype != CX_JSON_NO_TOKEN) { // single-char token json->buffer.pos = i + 1; - *result = (CxJsonToken){ctype, NULL, {0, 0}}; + *result = (CxJsonToken){ctype, false, {NULL, 0}}; return CX_JSON_NO_ERROR; } else { ttype = CX_JSON_TOKEN_LITERAL; // number or literal