summaryrefslogtreecommitdiff
path: root/geoid.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2017-09-08 08:21:49 -0400
committerEric S. Raymond <esr@thyrsus.com>2017-09-08 08:41:46 -0400
commit03bd97a3fc1cd5270f75113c671b4db3db57a6ff (patch)
treeb650155ffd760394b8f30d692b00ee74d888af7b /geoid.c
parent664bc79d8a944feedf237e7e9443b566b057835d (diff)
downloadgpsd-03bd97a3fc1cd5270f75113c671b4db3db57a6ff.tar.gz
Repair bounds-checking in geoid.c.
Diffstat (limited to 'geoid.c')
-rw-r--r--geoid.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/geoid.c b/geoid.c
index c0523297..4a6a39a7 100644
--- a/geoid.c
+++ b/geoid.c
@@ -129,14 +129,14 @@ void ecef_to_wgs84fix(struct gps_fix_t *fix, double *separation,
/* sanity check the climb, 10,000 m/s should be a nice max */
if ( 9999.9 < fix->climb )
fix->climb = NAN;
- else if ( -9999.9 > fix->speed )
+ else if ( -9999.9 > fix->climb )
fix->climb = NAN;
fix->speed = sqrt(pow(vnorth, 2) + pow(veast, 2));
/* sanity check the speed, 10,000 m/s should be a nice max */
if ( 9999.9 < fix->speed )
fix->speed = NAN;
- else if ( -9999.9 > fix->climb )
+ else if ( -9999.9 > fix->speed )
fix->speed = NAN;
heading = atan2(fix_minuz(veast), fix_minuz(vnorth));