summaryrefslogtreecommitdiff
path: root/cgps.c
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2018-09-22 15:35:35 -0700
committerGary E. Miller <gem@rellim.com>2018-09-22 15:35:35 -0700
commitc97f5aceb456350c1549ddd6254c2d2edb88220a (patch)
tree2b4992542ef3460d00c00867f0dcaa1f3c0d21cd /cgps.c
parenta0fe409f3bed4dd785d17c877acb67738b570646 (diff)
downloadgpsd-c97f5aceb456350c1549ddd6254c2d2edb88220a.tar.gz
cgps: fix sta view for small number of sats.
Diffstat (limited to 'cgps.c')
-rw-r--r--cgps.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/cgps.c b/cgps.c
index ed97a869..eba03434 100644
--- a/cgps.c
+++ b/cgps.c
@@ -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;