FIX: ocat: CSV output now correctly handles non-existent fields in output (e.g. pressure)

This commit is contained in:
Jan-Piet Mens
2015-09-02 11:45:29 +02:00
parent 8f932972c2
commit d9985c3d01
+3
View File
@@ -100,6 +100,9 @@ void csv_output(JsonNode *json, output_type otype, JsonNode *fields)
if ((j = json_find_member(one, node->string_)) != NULL) {
print_one(j, inttypes);
printf("%c", node->next ? ',' : '\n');
} else {
/* specified field not in JSON for this row */
printf("%c", node->next ? ',' : '\n');
}
}
} else {