diff options
| author | Thomas Knudsen <busstoptaktik@users.noreply.github.com> | 2017-10-24 23:36:13 +0200 |
|---|---|---|
| committer | Kristian Evers <kristianevers@gmail.com> | 2017-10-29 14:02:13 +0100 |
| commit | 395ec20b5a661e77d048212182841e5684dd6757 (patch) | |
| tree | 07220b6c1e14564acc95cbbbcd385d702696c9f6 /src | |
| parent | b8f765def1c54ddd0e8c61fd4619f58aa35165ff (diff) | |
| download | PROJ-395ec20b5a661e77d048212182841e5684dd6757.tar.gz PROJ-395ec20b5a661e77d048212182841e5684dd6757.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) { |
