aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/suites/api/test_memory_funcs.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/test/suites/api/test_memory_funcs.c b/test/suites/api/test_memory_funcs.c
index ac58809..7cb4b73 100644
--- a/test/suites/api/test_memory_funcs.c
+++ b/test/suites/api/test_memory_funcs.c
@@ -25,11 +25,12 @@ static void create_and_free_complex_object()
static void create_and_free_object_with_oom()
{
+ int i;
+ char key[4];
json_t *obj = json_object();
- for (int i = 0; i < 10; i++)
+ for (i = 0; i < 10; i++)
{
- char key[4];
snprintf(key, sizeof key, "%d", i);
json_object_set_new(obj, key, json_integer(i));
}