aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Knudsen <busstoptaktik@users.noreply.github.com>2017-10-24 23:36:13 +0200
committerKristian Evers <kristianevers@gmail.com>2017-10-29 14:02:13 +0100
commit395ec20b5a661e77d048212182841e5684dd6757 (patch)
tree07220b6c1e14564acc95cbbbcd385d702696c9f6 /src
parentb8f765def1c54ddd0e8c61fd4619f58aa35165ff (diff)
downloadPROJ-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.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) {