From 43bac506a4fe234a12734054c9f4c81007a6eb75 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Fri, 11 Sep 2015 12:25:28 +0200 Subject: [PATCH] fix bad size for calloc. --- src/kernel/jsonconf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/kernel/jsonconf.c b/src/kernel/jsonconf.c index 1ea6e6ba3..9217a989a 100644 --- a/src/kernel/jsonconf.c +++ b/src/kernel/jsonconf.c @@ -230,7 +230,7 @@ static void json_terrain(cJSON *json, terrain_type *ter) { if (strcmp(child->string, "production") == 0) { cJSON *entry; int n, size = cJSON_GetArraySize(child); - ter->production = (terrain_production *)calloc(size + 1, sizeof(const item_type *)); + ter->production = (terrain_production *)calloc(size + 1, sizeof(terrain_production)); ter->production[size].type = 0; for (n = 0, entry = child->child; entry; entry = entry->next, ++n) { ter->production[n].type = rt_get_or_create(entry->string);