aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlijunlong <lijunlong@openresty.com>2026-06-28 19:38:40 +0800
committerlijunlong <lijunlong@openresty.com>2026-06-28 19:38:40 +0800
commit5ce46a80b10ef9d380a45c9e6cff9ecffbe71ebb (patch)
tree963a541f993890b7a3fb9c225c4129c451a959f6
parentfa418dcac3de13c9fe2ddc997bd53e92d793f0bc (diff)
downloadlua-cjson-2.1.0.19.tar.gz
lua-cjson-2.1.0.19.tar.bz2
lua-cjson-2.1.0.19.zip
bugfix: fix C99 for-loop declaration for GCC 4.8.5 C89 compatibilityHEAD2.1.0.19master
-rw-r--r--lua_cjson.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lua_cjson.c b/lua_cjson.c
index 8518a86..19c22f2 100644
--- a/lua_cjson.c
+++ b/lua_cjson.c
@@ -735,8 +735,9 @@ static int json_append_data(lua_State *l, json_config_t *cfg,
735 735
736static void json_append_newline_and_indent(strbuf_t *json, json_config_t *cfg, int depth) 736static void json_append_newline_and_indent(strbuf_t *json, json_config_t *cfg, int depth)
737{ 737{
738 int i;
738 strbuf_append_char(json, '\n'); 739 strbuf_append_char(json, '\n');
739 for (int i = 0; i < depth; i++) 740 for (i = 0; i < depth; i++)
740 strbuf_append_string(json, cfg->encode_indent); 741 strbuf_append_string(json, cfg->encode_indent);
741} 742}
742 743