aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Knudsen <busstoptaktik@users.noreply.github.com>2017-10-24 23:36:13 +0200
committerGitHub <noreply@github.com>2017-10-24 23:36:13 +0200
commit2ad201bdb0f3408eed0aab07fe255c6ff1cd3249 (patch)
tree07220b6c1e14564acc95cbbbcd385d702696c9f6 /src
parent674144d8763892a4c29dbd7dd4f514985819b6a7 (diff)
downloadPROJ-2ad201bdb0f3408eed0aab07fe255c6ff1cd3249.tar.gz
PROJ-2ad201bdb0f3408eed0aab07fe255c6ff1cd3249.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/gie.c6
1 files changed, 3 insertions, 3 deletions
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) {