Fix empty array dumping
authorPetri Lehtinen <petri@digip.org>
Fri, 3 Jul 2009 20:22:47 +0000 (23:22 +0300)
committerPetri Lehtinen <petri@digip.org>
Sat, 4 Jul 2009 10:19:41 +0000 (13:19 +0300)
src/dump.c

index 7a566d9..02692f7 100644 (file)
@@ -145,7 +145,7 @@ static int do_dump(const json_t *json, uint32_t flags, int depth,
             if(dump("[", 1, data))
                 return -1;
             if(n == 0)
-                dump("]", 1, data);
+                return dump("]", 1, data);
             if(dump_indent(flags, depth + 1, dump, data))
                 return -1;