src/json.c

changeset 1026
ca20f9ffcb62
parent 1020
e78e65405c56
--- a/src/json.c	Wed Dec 18 15:36:45 2024 +0100
+++ b/src/json.c	Wed Dec 18 15:40:13 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

mercurial