summaryrefslogtreecommitdiff
path: root/cgps.c
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2018-09-25 15:47:38 -0700
committerGary E. Miller <gem@rellim.com>2018-09-25 15:47:38 -0700
commitc29acb17ce75c068dfb93a847ae2c62f36161aa3 (patch)
tree0487ebebba4015f6d3285c506cb680f8937a2fd1 /cgps.c
parentff5015cfbfee9f3e4fcdd3f9cbdfaf739e154195 (diff)
downloadgpsd-c29acb17ce75c068dfb93a847ae2c62f36161aa3.tar.gz
cgps: small tweaks to make cppcheck happy.
Diffstat (limited to 'cgps.c')
-rw-r--r--cgps.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/cgps.c b/cgps.c
index fa6b80bb..b97975fb 100644
--- a/cgps.c
+++ b/cgps.c
@@ -531,7 +531,7 @@ static void update_gps_panel(struct gps_data_t *gpsdata, char *message)
/* This gets called once for each new GPS sentence. */
{
int newstate;
- char scr[128], *s;
+ char scr[60];
/* This is for the satellite status display. Originally lifted from
* xgps.c. Note that the satellite list may be truncated based on
@@ -730,8 +730,9 @@ static void update_gps_panel(struct gps_data_t *gpsdata, char *message)
if (window_ysize >= (MIN_GPS_DATAWIN_YSIZE + 5)) {
int row = 9;
- char *ep_str = NULL;
- char *dop_str = NULL;
+ char *ep_str;
+ char *dop_str;
+ char *str;
/* Fill in the estimated latitude position error, XDOP. */
ep_str = ep_to_str(gpsdata->fix.epx, altfactor, altunits);
@@ -757,7 +758,7 @@ static void update_gps_panel(struct gps_data_t *gpsdata, char *message)
double sep = NAN; /* 3D EP */
/* Calculate estimated 2D circular position error, CEP */
- if (isfinite(gpsdata->fix.epy) != 0
+ if (isfinite(gpsdata->fix.epx) != 0
&& isfinite(gpsdata->fix.epy) != 0) {
/* http://gauss.gge.unb.ca/papers.pdf/gpsworld.may99.pdf */
/* CEP is just the hypotenuse of the triangle of epx and epy */
@@ -843,11 +844,11 @@ static void update_gps_panel(struct gps_data_t *gpsdata, char *message)
/* Fill in the grid square (esr thought *this* one was interesting). */
if ((isfinite(gpsdata->fix.longitude) != 0 &&
isfinite(gpsdata->fix.latitude) != 0))
- s = maidenhead(gpsdata->fix.latitude,gpsdata->fix.longitude);
+ str = maidenhead(gpsdata->fix.latitude,gpsdata->fix.longitude);
else
- s = "n/a";
+ str = "n/a";
(void)mvwprintw(datawin, row++, DATAWIN_VALUE_OFFSET + 9, "%-*s",
- 18, s);
+ 18, str);
}