# HG changeset patch # User Mike Becker # Date 1734274011 -3600 # Node ID e78e65405c5642e288a69210612d76ee51007c7f # Parent 09c6fe8fe3b98eeda6d9c2659eb264e2fac3a3ec fix wrong "variant" of zero/NULL/false diff -r 09c6fe8fe3b9 -r e78e65405c56 src/json.c --- 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