From fb32ebcd18088b313da788630908eeb73ba684f7 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Thu, 9 Oct 2014 08:34:03 +0200 Subject: [PATCH] segmentation fault in export when a plane has no name (default plane). --- src/json.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/json.c b/src/json.c index 181d7f593..103e530af 100644 --- a/src/json.c +++ b/src/json.c @@ -71,7 +71,7 @@ int json_export(stream * out, int flags) { cJSON_AddNumberToObject(data, "y", p->miny); cJSON_AddNumberToObject(data, "width", p->maxx-p->minx); cJSON_AddNumberToObject(data, "height", p->maxy-p->miny); - cJSON_AddStringToObject(data, "name", p->name); + if (p->name) cJSON_AddStringToObject(data, "name", p->name); } cJSON_AddItemToObject(root, "regions", json = cJSON_CreateObject());