summaryrefslogtreecommitdiff
path: root/libgps.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2005-07-11 17:48:12 +0000
committerEric S. Raymond <esr@thyrsus.com>2005-07-11 17:48:12 +0000
commitf8a78c0981fb76eedb5c0ef63db8b3ae34726008 (patch)
treedb8f48c388abe8401237dfd9d97ae4f2f09edd8c /libgps.c
parent2419386a8b6112b87e2e76a0b595f94ee02ec196 (diff)
downloadgpsd-f8a78c0981fb76eedb5c0ef63db8b3ae34726008.tar.gz
Add support for the 2-field return of C to client libraries.
Diffstat (limited to 'libgps.c')
-rw-r--r--libgps.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/libgps.c b/libgps.c
index 5f04e17a..50f5edd6 100644
--- a/libgps.c
+++ b/libgps.c
@@ -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] == '?')