mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-04 01:15:41 +02:00
More sensible way of passing errors back to caller
This commit is contained in:
@@ -77,14 +77,19 @@ void json_print(json_object *j, int depth) {
|
||||
|
||||
void process(FILE *f) {
|
||||
json_object *j = NULL;
|
||||
char *error = NULL;
|
||||
|
||||
while ((j = json_parse(f, j)) != NULL) {
|
||||
while ((j = json_parse(f, j, &error)) != NULL) {
|
||||
if (j->parent == NULL) {
|
||||
json_print(j, 0);
|
||||
printf("\n");
|
||||
j = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (error != NULL) {
|
||||
fprintf(stderr, "%s\n", error);
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
|
||||
Reference in New Issue
Block a user