diff options
| author | Thomas Knudsen <busstoptaktik@users.noreply.github.com> | 2017-10-24 23:36:13 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-10-24 23:36:13 +0200 |
| commit | 2ad201bdb0f3408eed0aab07fe255c6ff1cd3249 (patch) | |
| tree | 07220b6c1e14564acc95cbbbcd385d702696c9f6 /src | |
| parent | 674144d8763892a4c29dbd7dd4f514985819b6a7 (diff) | |
| download | PROJ-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.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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) { |
