summaryrefslogtreecommitdiff
path: root/nmea_parse.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2005-05-20 07:24:36 +0000
committerEric S. Raymond <esr@thyrsus.com>2005-05-20 07:24:36 +0000
commitba76c6748e2eabbcfa9c0c29323b9b5b44916e30 (patch)
treed831d29facffeb40af44cea9bf76b5820e4707f1 /nmea_parse.c
parentc5dee64de02c9f47674f64dc08c9e11a7c678522 (diff)
downloadgpsd-ba76c6748e2eabbcfa9c0c29323b9b5b44916e30.tar.gz
More attempts to squash the devicename-smashing bug.
Diffstat (limited to 'nmea_parse.c')
-rw-r--r--nmea_parse.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/nmea_parse.c b/nmea_parse.c
index ba6a56c8..9a4fd925 100644
--- a/nmea_parse.c
+++ b/nmea_parse.c
@@ -341,12 +341,15 @@ static int processGPGSV(int count, char *field[], struct gps_data_t *out)
There my be up to three GSV sentences in a data packet
*/
int n, fldnum;
- if (count <= 3)
+ if (count <= 3) {
+ gpsd_zero_satellites(out);
return ERROR_SET;
+ }
out->await = atoi(field[1]);
- if (sscanf(field[2], "%d", &out->part) < 1)
+ if (sscanf(field[2], "%d", &out->part) < 1) {
+ gpsd_zero_satellites(out);
return ERROR_SET;
- else if (out->part == 1)
+ } else if (out->part == 1)
gpsd_zero_satellites(out);
for (fldnum = 4; fldnum < count; ) {
@@ -384,6 +387,7 @@ static int processGPGSV(int count, char *field[], struct gps_data_t *out)
if (out->azimuth[n])
goto sane;
gpsd_report(3, "Satellite data no good.\n");
+ gpsd_zero_satellites(out);
return ERROR_SET;
sane:
gpsd_report(3, "Satellite data OK.\n");