From 2ad201bdb0f3408eed0aab07fe255c6ff1cd3249 Mon Sep 17 00:00:00 2001 From: Thomas Knudsen Date: Tue, 24 Oct 2017 23:36:13 +0200 Subject: Make gie roundtrips compatible with updated proj_strtod In order to mimic strtod, proj_strtod now returns 0 and not HUGE_VAL on nonnumeric input. Hence, we must check the return pointers to identify an error. --- src/gie.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/gie.c b/src/gie.c index 6ff157ac..33fc4d82 100644 --- a/src/gie.c +++ b/src/gie.c @@ -457,11 +457,11 @@ static int accept (char *args) { static int roundtrip (char *args) { int ntrips; double d, r, ans; - char *endp; + char *endp, *endq; ans = proj_strtod (args, &endp); ntrips = (int) (ans==HUGE_VAL? 100: fabs(ans)); - d = proj_strtod (endp, &endp); - d = d==HUGE_VAL? T.tolerance: d / 1000; + d = proj_strtod (endp, &endq); + d = (endp==endq)? T.tolerance: d / 1000; r = proj_roundtrip (T.P, PJ_FWD, ntrips, T.a); if (r > d) { if (T.verbosity > -1) { -- cgit v1.2.3