diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2011-09-16 16:34:37 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2011-09-16 16:34:37 -0400 |
commit | b61cf93880d452a76caabad2112dda8ab441f456 (patch) | |
tree | 355cdf46c6226b4f181b3158eb5bf00282cdbc5d /cgps.c | |
parent | 03d4688d621f644c3bbb7913ed561855fc7b6baf (diff) | |
download | gpsd-b61cf93880d452a76caabad2112dda8ab441f456.tar.gz |
Add a sanoty check.
Diffstat (limited to 'cgps.c')
-rw-r--r-- | cgps.c | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -632,12 +632,14 @@ static void update_gps_panel(struct gps_data_t *gpsdata) } (void)mvwprintw(datawin, 8, DATAWIN_VALUE_OFFSET, "%-*s", 27, scr); - /* Fill in receiver type. */ - for (i = 0; i < gpsdata->devices.ndevices; i++) - if (strcmp(gpsdata->devices.list[i].path, gpsdata->dev.path) == 0) - break; - (void)snprintf(scr, sizeof(scr), "%s", gpsdata->devices.list[i].driver); - (void)mvwprintw(datawin, 9, DATAWIN_VALUE_OFFSET, "%-*s", 27, scr); + if (gpsdata->set & DEVICELIST_SET) { + /* Fill in receiver type. */ + for (i = 0; i < gpsdata->devices.ndevices; i++) + if (strcmp(gpsdata->devices.list[i].path, gpsdata->dev.path) == 0) + break; + (void)snprintf(scr, sizeof(scr), "%s", gpsdata->devices.list[i].driver); + (void)mvwprintw(datawin, 9, DATAWIN_VALUE_OFFSET, "%-*s", 27, scr); + } /* Note that the following fields are exceptions to the * sizing rule. The minimum window size does not include these * fields, if the window is too small, they get excluded. This |