]> git.kaiwu.me - klib.git/commitdiff
no effective changes
authorHeng Li <lh3@me.com>
Sat, 29 Nov 2014 18:00:19 +0000 (13:00 -0500)
committerHeng Li <lh3@me.com>
Sat, 29 Nov 2014 18:00:19 +0000 (13:00 -0500)
kson.c
kson.h

diff --git a/kson.c b/kson.c
index 38d1c154d1ceea71da633a19c23fe3919c572306..c09becadba27c9283bd7ccf979b348b04aedfe20 100644 (file)
--- a/kson.c
+++ b/kson.c
@@ -108,14 +108,14 @@ void kson_destroy(kson_t *kson)
 
 kson_t *kson_parse(const char *json, int *error)
 {
-       kson_t *ks;
-       ks = (kson_t*)calloc(1, sizeof(kson_t));
-       ks->nodes = kson_parse_core(json, &ks->n_nodes, error, 0);
+       kson_t *kson;
+       kson = (kson_t*)calloc(1, sizeof(kson_t));
+       kson->nodes = kson_parse_core(json, &kson->n_nodes, error, 0);
        if (*error) {
-               kson_destroy(ks);
+               kson_destroy(kson);
                return 0;
        }
-       return ks;
+       return kson;
 }
 
 void kson_print_recur(kson_node_t *nodes, kson_node_t *p)
diff --git a/kson.h b/kson.h
index 4e8664c25a35241dcd47c64d7eec8e9637b4e089..8b0a1e2592f51566d024745d5c707b172dd1d635 100644 (file)
--- a/kson.h
+++ b/kson.h
@@ -47,7 +47,7 @@ extern "C" {
        // Equivalent to: { kson->nodes = kson_parse_core(json, &kson->n_nodes, &error, 0); return *error? 0 : kson; } 
        kson_t *kson_parse(const char *json, int *error);
 
-       void kson_destroy(kson_t *ks);
+       void kson_destroy(kson_t *kson);
        void kson_print(kson_t *kson);
 
 #ifdef __cplusplus