Browse Source

Removed spaces after \n for arrays as well

tags/json-c-0.14-20200419
Darjan Krijan 6 years ago
parent
commit
3943960874
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      json_object.c

+ 2
- 2
json_object.c View File

@@ -1127,7 +1127,7 @@ static int json_object_array_to_json_string(struct json_object* jso,
printbuf_strappend(pb, "\n");
}
had_children = 1;
if (flags & JSON_C_TO_STRING_SPACED)
if (flags & JSON_C_TO_STRING_SPACED && !(flags&JSON_C_TO_STRING_PRETTY))
printbuf_strappend(pb, " ");
indent(pb, level + 1, flags);
val = json_object_array_get_idx(jso, ii);
@@ -1144,7 +1144,7 @@ static int json_object_array_to_json_string(struct json_object* jso,
indent(pb,level,flags);
}

if (flags & JSON_C_TO_STRING_SPACED)
if (flags & JSON_C_TO_STRING_SPACED && !(flags&JSON_C_TO_STRING_PRETTY))
return printbuf_strappend(pb, " ]");
return printbuf_strappend(pb, "]");
}


Loading…
Cancel
Save