Skip to content
This repository was archived by the owner on Aug 7, 2025. It is now read-only.

Commit 31205d7

Browse files
bmanojlovicahkok
authored andcommitted
make older compilers a bit happier
1 parent 4399863 commit 31205d7

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/json.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ static bool g_filter, g_ban, g_score, g_pattern = false;
3636

3737
static int json_parse(json_object *ob)
3838
{
39-
int count = 0;
39+
int i, count = 0;
4040
bool l_filter, l_ban, l_score, l_pattern = false;
4141

4242
json_object_object_foreach(ob, key, val) {
@@ -81,7 +81,7 @@ static int json_parse(json_object *ob)
8181
ob = json_object_object_get(ob, key);
8282
int len = json_object_array_length(ob);
8383
json_object *val;
84-
for (int i = 0; i < len; i++) {
84+
for (i = 0; i < len; i++) {
8585
val = json_object_array_get_idx(ob, i);
8686
count += json_parse(val);
8787
}
@@ -119,7 +119,7 @@ static int json_parse(json_object *ob)
119119

120120
static int json_load_file(const char* file)
121121
{
122-
int count = 0;
122+
int i, count = 0;
123123
char *json;
124124
int fd;
125125
struct stat st;
@@ -134,7 +134,7 @@ static int json_load_file(const char* file)
134134
if (json_object_is_type(obj,json_type_array)) {
135135
int len = json_object_array_length(obj);
136136
json_object *val;
137-
for (int i = 0; i < len; i++) {
137+
for (i = 0; i < len; i++) {
138138
val = json_object_array_get_idx(obj, i);
139139
count += json_parse(val);
140140
}

0 commit comments

Comments
 (0)