diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2005-07-11 17:48:12 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2005-07-11 17:48:12 +0000 |
commit | f8a78c0981fb76eedb5c0ef63db8b3ae34726008 (patch) | |
tree | db8f48c388abe8401237dfd9d97ae4f2f09edd8c /libgps.c | |
parent | 2419386a8b6112b87e2e76a0b595f94ee02ec196 (diff) | |
download | gpsd-f8a78c0981fb76eedb5c0ef63db8b3ae34726008.tar.gz |
Add support for the 2-field return of C to client libraries.
Diffstat (limited to 'libgps.c')
-rw-r--r-- | libgps.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -158,9 +158,13 @@ static void gps_unpack(char *buf, struct gps_data_t *gpsdata) break; case 'C': if (sp[2] == '?') - gpsdata->cycle = 0; - else - (void)sscanf(sp, "C=%lf", &gpsdata->cycle); + gpsdata->mincycle = gpsdata->cycle = 0; + else { + if (sscanf(sp, "C=%lf %lf", + &gpsdata->cycle, + &gpsdata->mincycle) < 2) + gpsdata->mincycle = gpsdata->cycle; + } break; case 'D': if (sp[2] == '?') |