From 05c5360bf99ef687a57c14575fd1fac79f0040ed Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sat, 17 Sep 2011 20:46:45 -0400 Subject: Defensive programming. --- cgps.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cgps.c') diff --git a/cgps.c b/cgps.c index b6be040f..7d55df7d 100644 --- a/cgps.c +++ b/cgps.c @@ -567,7 +567,7 @@ static void update_gps_panel(struct gps_data_t *gpsdata) (void)mvwprintw(datawin, 3, DATAWIN_VALUE_OFFSET, "%-*s", 27, scr); /* Fill in the altitude. */ - if (gpsdata->fix.mode == MODE_3D && isnan(gpsdata->fix.altitude) == 0) + if (gpsdata->fix.mode >= MODE_3D && isnan(gpsdata->fix.altitude) == 0) (void)snprintf(scr, sizeof(scr), "%.1f %s", gpsdata->fix.altitude * altfactor, altunits); else @@ -597,7 +597,7 @@ static void update_gps_panel(struct gps_data_t *gpsdata) (void)mvwprintw(datawin, 6, DATAWIN_VALUE_OFFSET, "%-*s", 27, scr); /* Fill in the rate of climb. */ - if (gpsdata->fix.mode == MODE_3D && isnan(gpsdata->fix.climb) == 0) + if (gpsdata->fix.mode >= MODE_3D && isnan(gpsdata->fix.climb) == 0) (void)snprintf(scr, sizeof(scr), "%.1f %s/min", gpsdata->fix.climb * altfactor * 60, altunits); else @@ -644,7 +644,7 @@ static void update_gps_panel(struct gps_data_t *gpsdata) * sizing rule. The minimum window size does not include these * fields, if the window is too small, they get excluded. This * may or may not change if/when the output for these fields is - * fixed and/or people request their permanance. They're only + * fixed and/or people request their permanence. They're only * there in the first place because I arbitrarily thought they * sounded interesting. ;^) */ -- cgit v1.2.1