summaryrefslogtreecommitdiff
path: root/lcdgps.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2013-04-30 23:04:53 -0400
committerEric S. Raymond <esr@thyrsus.com>2013-04-30 23:05:37 -0400
commit321c7710c3f3a17d56e9e5eede9aebadbaf16e3e (patch)
treefae8712111ede1cd948e8846a3bbdafeb8dfd45a /lcdgps.c
parent5aa7ce8d00de15c832ab90113ef5b08221746e7f (diff)
downloadgpsd-321c7710c3f3a17d56e9e5eede9aebadbaf16e3e.tar.gz
Fix static-checker warnings. All regression tests pass.
cppchecker now finds variables that could have reduced scope; that's most of these.
Diffstat (limited to 'lcdgps.c')
-rw-r--r--lcdgps.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lcdgps.c b/lcdgps.c
index 2bfe7ac1..df560559 100644
--- a/lcdgps.c
+++ b/lcdgps.c
@@ -180,7 +180,7 @@ static enum deg_str_type deg_type = deg_dd;
static void update_lcd(struct gps_data_t *gpsdata)
{
char tmpbuf[255];
- char *s, *gridsquare;
+ char *gridsquare;
/* Get our location in Maidenhead. */
gridsquare = maidenhead(gpsdata->fix.latitude,gpsdata->fix.longitude);
@@ -188,6 +188,7 @@ static void update_lcd(struct gps_data_t *gpsdata)
/* Fill in the latitude and longitude. */
if (gpsdata->fix.mode >= MODE_2D) {
int track;
+ char *s;
s = deg_to_str(deg_type, fabs(gpsdata->fix.latitude));
snprintf(tmpbuf, 254, "widget_set gpsd one 1 1 {Lat: %s %c}\n", s, (gpsdata->fix.latitude < 0) ? 'S' : 'N');