diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2011-09-17 20:46:45 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2011-09-17 20:46:45 -0400 |
commit | 05c5360bf99ef687a57c14575fd1fac79f0040ed (patch) | |
tree | 21f4daeb4eacb9f209e90df65058ee20740fe982 /cgps.c | |
parent | 0f91e5477fb5632149c02884e58dd5b39d2267f5 (diff) | |
download | gpsd-05c5360bf99ef687a57c14575fd1fac79f0040ed.tar.gz |
Defensive programming.
Diffstat (limited to 'cgps.c')
-rw-r--r-- | cgps.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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. ;^) */ |