From 5ce46a80b10ef9d380a45c9e6cff9ecffbe71ebb Mon Sep 17 00:00:00 2001 From: lijunlong Date: Sun, 28 Jun 2026 19:38:40 +0800 Subject: bugfix: fix C99 for-loop declaration for GCC 4.8.5 C89 compatibility --- lua_cjson.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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, static void json_append_newline_and_indent(strbuf_t *json, json_config_t *cfg, int depth) { + int i; strbuf_append_char(json, '\n'); - for (int i = 0; i < depth; i++) + for (i = 0; i < depth; i++) strbuf_append_string(json, cfg->encode_indent); } -- cgit v1.2.3-55-g6feb