From ddc22ff56acef0690abfd22ee640cda4eb143933 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Wed, 16 May 2012 20:42:26 -0400 Subject: Cleanup motivated by new cppcheck with more tests. All regression tests pass. --- drivers.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers.c') diff --git a/drivers.c b/drivers.c index 6220e85b..5537a55e 100644 --- a/drivers.c +++ b/drivers.c @@ -1078,7 +1078,6 @@ static gps_mask_t processMTK3301(struct gps_device_t *session) { const char *mtk_reasons[4] = { "Invalid", "Unsupported", "Valid but Failed", "Valid success" }; - int msg, reason; gps_mask_t mask; /* try a straight NMEA parse, this will set up fields */ @@ -1087,6 +1086,8 @@ static gps_mask_t processMTK3301(struct gps_device_t *session) if (session->packet.type == NMEA_PACKET && strncmp(session->driver.nmea.field[0], "PMTK", 4) == 0) { + int msg, reason; + msg = atoi(&(session->driver.nmea.field[0])[4]); switch (msg) { case 705: /* */ -- cgit v1.2.1