From 4ba84302043e03e7924f5890ac029a4ff93eec0e Mon Sep 17 00:00:00 2001 From: Heng Li Date: Sat, 29 Nov 2014 18:24:52 -0500 Subject: [PATCH] minor change --- kson.c | 2 +- kson.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) 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 } -- 2.47.3