diff options
author | Gary E. Miller <gem@rellim.com> | 2012-05-03 13:26:16 -0700 |
---|---|---|
committer | Gary E. Miller <gem@rellim.com> | 2012-05-03 13:26:16 -0700 |
commit | cc41ee67450def029269c1383b0bfea8f192e1d4 (patch) | |
tree | c0a72548ba98095f51d819f1cfbfe810b8475283 /libgpsd_core.c | |
parent | 50bf6d12cba03715b085ccc2f9df90e71e97ac4a (diff) | |
download | gpsd-cc41ee67450def029269c1383b0bfea8f192e1d4.tar.gz |
fixcnt was never cleared on a bad fix.
Found by: Hal Murray <hmurray@megapathdsl.net>
Diffstat (limited to 'libgpsd_core.c')
-rw-r--r-- | libgpsd_core.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/libgpsd_core.c b/libgpsd_core.c index 9444c86f..10d35d8d 100644 --- a/libgpsd_core.c +++ b/libgpsd_core.c @@ -1127,10 +1127,14 @@ gps_mask_t gpsd_poll(struct gps_device_t *session) * devices output fix packets on a regular basis, even when unable * to derive a good fix. Such packets should set STATUS_NO_FIX. */ - if ((session->gpsdata.set & LATLON_SET) != 0 - && session->gpsdata.status > STATUS_NO_FIX) { - session->context->fixcnt++; - session->fixcnt++; + if ( 0 != session->gpsdata.set & LATLON_SET) { + if ( session->gpsdata.status > STATUS_NO_FIX) { + session->context->fixcnt++; + session->fixcnt++; + } else { + session->context->fixcnt = 0; + session->fixcnt = 0; + } } /* |