Index: json-c-0.13.1/json_object.c =================================================================== --- json-c-0.13.1.orig/json_object.c 2016-01-05 14:12:12.868846806 +0800 +++ json-c-0.13.1/json_object.c 2016-01-05 14:13:19.041220540 +0800 @@ -283,7 +283,7 @@ const char* json_object_to_json_string(struct json_object *jso) { - return json_object_to_json_string_ext(jso, JSON_C_TO_STRING_SPACED); + return json_object_to_json_string_ext(jso, JSON_C_TO_STRING_SPACED | JSON_C_TO_STRING_PRETTY); } static void indent(struct printbuf *pb, int level, int flags) Index: json-c-0.13.1/json_util.c =================================================================== --- json-c-0.13.1.orig/json_util.c 2016-01-05 14:12:12.868846806 +0800 +++ json-c-0.13.1/json_util.c 2016-01-05 14:25:43.149088029 +0800 @@ -144,7 +144,7 @@ int json_object_to_file(const char *filename, struct json_object *obj) { - return json_object_to_file_ext(filename, obj, JSON_C_TO_STRING_PLAIN); + return json_object_to_file_ext(filename, obj, JSON_C_TO_STRING_PLAIN | JSON_C_TO_STRING_PRETTY); } int json_parse_double(const char *buf, double *retval)