src/json.c

changeset 1020
e78e65405c56
parent 1014
56eb7da4f3e1
--- 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

mercurial