Browse Source

Fixed JSON string parsing.

default 1 month ago
parent
commit
bec4836533
1 changed files with 6 additions and 0 deletions
  1. 6 0
      xs_json.h

+ 6 - 0
xs_json.h

@@ -280,6 +280,12 @@ static xs_val *_xs_json_load_lexer(FILE *f, js_type *t)
             else {
                 char cc = c;
                 v = xs_insert_m(v, offset, &cc, 1);
+
+                if (!xs_is_string(v)) {
+                    *t = JS_ERROR;
+                    break;
+                }
+
                 offset++;
             }
         }