summaryrefslogtreecommitdiff
path: root/xgps.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2005-01-19 19:03:07 +0000
committerEric S. Raymond <esr@thyrsus.com>2005-01-19 19:03:07 +0000
commit7902512ada3089f1b8a9557f9c7bccff2d4468fe (patch)
tree08ec89964fd5e973df88003e5fdc84a8d6cd2eb6 /xgps.c
parent32b4c4b163498db22c53b31febd985f589269060 (diff)
downloadgpsd-7902512ada3089f1b8a9557f9c7bccff2d4468fe.tar.gz
Cleaner way to avoid leaking.
Diffstat (limited to 'xgps.c')
-rw-r--r--xgps.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/xgps.c b/xgps.c
index e9cc6d60..59c01693 100644
--- a/xgps.c
+++ b/xgps.c
@@ -219,7 +219,8 @@ static void handle_input(XtPointer client_data UNUSED, int *source UNUSED,
static void update_panel(char *message)
/* runs on each sentence */
{
- int i, newstate;
+ unsigned int i;
+ int newstate;
XmString string[MAXCHANNELS+1];
char s[128], *sp;
@@ -231,7 +232,7 @@ static void update_panel(char *message)
/* This is for the satellite status display */
if (SEEN(gpsdata->satellite_stamp)) {
for (i = 0; i < MAXCHANNELS; i++) {
- if (i < gpsdata->satellites) {
+ if (i < (unsigned int)gpsdata->satellites) {
sprintf(s, " %2d %02d %03d %02d %c",
gpsdata->PRN[i],
gpsdata->elevation[i], gpsdata->azimuth[i],
@@ -242,7 +243,7 @@ static void update_panel(char *message)
string[i+1] = XmStringCreateSimple(s);
}
XmListReplaceItemsPos(satellite_list, string, sizeof(string), 1);
- for (i = 0; i < MAXCHANNELS+1; i++)
+ for (i = 0; i < sizeof(string)/sizeof(string[0]); i++)
XmStringFree(string[i]);
}
/* here are the value fields */