From 7b6cd2d0f43c54d35b296d5c14f2fcb8dc9956b1 Mon Sep 17 00:00:00 2001 From: Eric Fischer Date: Mon, 4 Apr 2016 11:25:21 -0700 Subject: [PATCH] Fix the any-valid-geometries check again --- geojson.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/geojson.c b/geojson.c index 87474cf1..987455c6 100644 --- a/geojson.c +++ b/geojson.c @@ -2264,6 +2264,11 @@ int read_json(int argc, struct source **sourcelist, char *fname, const char *lay munmap(map, indexpos); } + if (indexpos == 0) { + fprintf(stderr, "Did not read any valid geometries\n"); + exit(EXIT_FAILURE); + } + /* Copy geometries to a new file in index order */ struct index *index_map = mmap(NULL, indexpos, PROT_READ, MAP_PRIVATE, indexfd, 0); @@ -2301,11 +2306,6 @@ int read_json(int argc, struct source **sourcelist, char *fname, const char *lay size[j] = 0; } - if (geompos == 0 || metapos == 0) { - fprintf(stderr, "did not read any valid geometries\n"); - exit(EXIT_FAILURE); - } - if (!quiet) { fprintf(stderr, "%lld features, %lld bytes of geometry, %lld bytes of metadata, %lld bytes of string pool\n", progress_seq, geompos, metapos, poolpos); }