From 45655b2106513d71a2d8373a5259e5a9caaf1566 Mon Sep 17 00:00:00 2001 From: Jan-Piet Mens Date: Mon, 7 Mar 2016 10:42:57 +0100 Subject: [PATCH] unbreak XML and CSV output --- ocat.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/ocat.c b/ocat.c index 17d107a..782b7c3 100644 --- a/ocat.c +++ b/ocat.c @@ -349,19 +349,9 @@ int main(int argc, char **argv) } json_delete(user_array); } else if (otype == CSV) { - JsonNode *o = json_mkobject(); - - json_append_member(o, "locations", user_array); - csv_output(o, CSV, fields, print_xml_line, xmlp); - json_delete(o); - + csv_output(user_array, CSV, fields, print_xml_line, xmlp); } else if (otype == XML) { - JsonNode *o = json_mkobject(); - - json_append_member(o, "locations", user_array); - xml_output(o, XML, fields, print_xml_line, xmlp); - json_delete(o); - + xml_output(user_array, XML, fields, print_xml_line, xmlp); } else { fprintf(stderr, "%s: unsupported output type for LAST\n", progname); } @@ -483,9 +473,9 @@ int main(int argc, char **argv) } } else if (otype == CSV) { - csv_output(obj, CSV, fields, print_xml_line, xmlp); + csv_output(locs, CSV, fields, print_xml_line, xmlp); } else if (otype == XML) { - xml_output(obj, XML, fields, print_xml_line, xmlp); + xml_output(locs, XML, fields, print_xml_line, xmlp); } else if (otype == RAW || otype == RAWPAYLOAD) { /* We've already done what we need to do in locations() */ } else if (otype == LINESTRING) {