diff options
author | Gary E. Miller <gem@rellim.com> | 2018-09-22 15:35:35 -0700 |
---|---|---|
committer | Gary E. Miller <gem@rellim.com> | 2018-09-22 15:35:35 -0700 |
commit | c97f5aceb456350c1549ddd6254c2d2edb88220a (patch) | |
tree | 2b4992542ef3460d00c00867f0dcaa1f3c0d21cd /cgps.c | |
parent | a0fe409f3bed4dd785d17c877acb67738b570646 (diff) | |
download | gpsd-c97f5aceb456350c1549ddd6254c2d2edb88220a.tar.gz |
cgps: fix sta view for small number of sats.
Diffstat (limited to 'cgps.c')
-rw-r--r-- | cgps.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -545,11 +545,13 @@ static void update_gps_panel(struct gps_data_t *gpsdata, char *message) if (gpsdata->satellites_visible != 0) { int sat_no; + int loop_end = (display_sats < gpsdata->satellites_visible) ? \ + display_sats : gpsdata->satellites_visible; qsort( gpsdata->skyview, gpsdata->satellites_visible, sizeof( struct satellite_t), sat_cmp); /* displayed all sats that fit, maybe all of them */ - for (sat_no = 0; sat_no <= display_sats; sat_no++) { + for (sat_no = 0; sat_no < loop_end; sat_no++) { int column = 1; /* column to write to */ char *gnssid; |