summaryrefslogtreecommitdiff
path: root/xs_json.h
diff options
context:
space:
mode:
authorGravatar default2024-08-30 19:10:26 +0200
committerGravatar default2024-08-30 19:10:26 +0200
commit0218e964b0d73340c8d0c5d9e37991359d7c4be9 (patch)
tree9cfc1650abf8780be52dc219e37a311244a294e2 /xs_json.h
parenttimeline_del() also deletes from the pinned and bookmark caches. (diff)
downloadsnac2-0218e964b0d73340c8d0c5d9e37991359d7c4be9.tar.gz
snac2-0218e964b0d73340c8d0c5d9e37991359d7c4be9.tar.xz
snac2-0218e964b0d73340c8d0c5d9e37991359d7c4be9.zip
Backport from xs.
Diffstat (limited to 'xs_json.h')
-rw-r--r--xs_json.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/xs_json.h b/xs_json.h
index 3a91de9..de9600f 100644
--- a/xs_json.h
+++ b/xs_json.h
@@ -75,7 +75,6 @@ static void _xs_json_dump(const xs_val *data, int level, int indent, FILE *f)
75/* dumps partial data as JSON */ 75/* dumps partial data as JSON */
76{ 76{
77 int c = 0; 77 int c = 0;
78 int ct = 0;
79 const xs_val *v; 78 const xs_val *v;
80 79
81 switch (xs_type(data)) { 80 switch (xs_type(data)) {
@@ -98,7 +97,7 @@ static void _xs_json_dump(const xs_val *data, int level, int indent, FILE *f)
98 case XSTYPE_LIST: 97 case XSTYPE_LIST:
99 fputc('[', f); 98 fputc('[', f);
100 99
101 while (xs_list_next(data, &v, &ct)) { 100 xs_list_foreach(data, v) {
102 if (c != 0) 101 if (c != 0)
103 fputc(',', f); 102 fputc(',', f);
104 103
@@ -118,7 +117,7 @@ static void _xs_json_dump(const xs_val *data, int level, int indent, FILE *f)
118 117
119 const xs_str *k; 118 const xs_str *k;
120 119
121 while (xs_dict_next(data, &k, &v, &ct)) { 120 xs_dict_foreach(data, k, v) {
122 if (c != 0) 121 if (c != 0)
123 fputc(',', f); 122 fputc(',', f);
124 123