aboutsummaryrefslogtreecommitdiff
path: root/lua_json.c
diff options
context:
space:
mode:
Diffstat (limited to 'lua_json.c')
-rw-r--r--lua_json.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/lua_json.c b/lua_json.c
index 25078a3..10810f0 100644
--- a/lua_json.c
+++ b/lua_json.c
@@ -247,8 +247,7 @@ char *lua_json_encode(lua_State *l, int *len)
247 strbuf_t buf; 247 strbuf_t buf;
248 char *json; 248 char *json;
249 249
250 strbuf_init(&buf); 250 strbuf_init(&buf, 0);
251 strbuf_set_increment(&buf, 256);
252 json_append_data(l, &buf); 251 json_append_data(l, &buf);
253 json = strbuf_free_to_string(&buf, len); 252 json = strbuf_free_to_string(&buf, len);
254 253
@@ -637,8 +636,7 @@ void lua_json_decode(lua_State *l, const char *json_text)
637 636
638 json.data = json_text; 637 json.data = json_text;
639 json.index = 0; 638 json.index = 0;
640 json.tmp = strbuf_new(); 639 json.tmp = strbuf_new(0);
641 strbuf_set_increment(json.tmp, 256);
642 640
643 json_next_token(&json, &token); 641 json_next_token(&json, &token);
644 json_process_value(l, &json, &token); 642 json_process_value(l, &json, &token);