]> git.kaiwu.me - klib.git/commitdiff
simplified format() due to a later change
authorHeng Li <lh3@me.com>
Sun, 30 Nov 2014 05:53:37 +0000 (00:53 -0500)
committerHeng Li <lh3@me.com>
Sun, 30 Nov 2014 05:53:37 +0000 (00:53 -0500)
kson.c

diff --git a/kson.c b/kson.c
index ad0a27584dcd17d6e7aaee132185593e9558ec9d..c5002fb789371c38c4a310b1e346efd57cf0c762 100644 (file)
--- a/kson.c
+++ b/kson.c
@@ -158,10 +158,7 @@ const kson_node_t *kson_query(const kson_node_t *p, int depth, ...)
 void kson_format_recur(const kson_node_t *p, int depth)
 {
        long i;
-       if (p->key) {
-               printf("\"%s\"", p->key);
-               if (p->v.str) putchar(':');
-       }
+       if (p->key) printf("\"%s\":", p->key);
        if (p->type == KSON_TYPE_BRACKET || p->type == KSON_TYPE_BRACE) {
                putchar(p->type == KSON_TYPE_BRACKET? '[' : '{');
                if (p->n) {