From: Heng Li Date: Sat, 29 Nov 2014 23:24:52 +0000 (-0500) Subject: minor change X-Git-Url: http://www.kaiwu.me/postgresql/commit/?a=commitdiff_plain;h=4ba84302043e03e7924f5890ac029a4ff93eec0e;p=klib.git minor change --- diff --git a/kson.c b/kson.c index 311780d..95114a1 100644 --- a/kson.c +++ b/kson.c @@ -79,7 +79,7 @@ kson_node_t *kson_parse_core(const char *json, long *_n, int *error, long *parse for (q = ++p; *q && *q != c; ++q) if (*q == '\\') ++q; } else { - for (q = p; *q && *q != ']' && *q != '}' && *q != ',' && *q != ':'; ++q) + for (q = p; *q && *q != ']' && *q != '}' && *q != ',' && *q != ':' && *q != '\n'; ++q) if (*q == '\\') ++q; } u->v.str = (char*)malloc(q - p + 1); strncpy(u->v.str, p, q - p); u->v.str[q-p] = 0; // equivalent to u->v.str=strndup(p, q-p) diff --git a/kson.h b/kson.h index 9a44fbc..44df500 100644 --- a/kson.h +++ b/kson.h @@ -50,7 +50,6 @@ extern "C" { const kson_node_t *kson_query(const kson_t *kson, int max_depth, ...); void kson_print(const kson_t *kson); - kson_node_t *kson_parse_core(const char *json, long *n_nodes, int *error, long *parsed_len); #ifdef __cplusplus }