summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--daemon.c3
-rw-r--r--driver_aivdm.c2
-rw-r--r--driver_navcom.c3
-rw-r--r--driver_nmea.c2
-rw-r--r--libgps_json.c3
-rw-r--r--net_ntrip.c2
6 files changed, 8 insertions, 7 deletions
diff --git a/daemon.c b/daemon.c
index 22afab68..1063afc9 100644
--- a/daemon.c
+++ b/daemon.c
@@ -19,10 +19,9 @@ int daemon(int nochdir, int noclose)
/* compatible with the daemon(3) found on Linuxes and BSDs */
{
int fd;
- pid_t pid;
/*@ -type @*//* weirdly, splint 3.1.2 is confused by fork() */
- switch (pid = fork()) {
+ switch (fork()) {
case -1:
return -1;
case 0: /* child side */
diff --git a/driver_aivdm.c b/driver_aivdm.c
index 7373b2a1..91b94cc0 100644
--- a/driver_aivdm.c
+++ b/driver_aivdm.c
@@ -77,7 +77,7 @@ bool aivdm_decode(const char *buf, size_t buflen,
int nfrags, ifrag, nfields = 0;
unsigned char *field[NMEA_MAX*2];
unsigned char fieldcopy[NMEA_MAX*2+1];
- unsigned char *data, *cp = fieldcopy;
+ unsigned char *data, *cp;
unsigned char ch, pad;
struct aivdm_context_t *ais_context;
int i;
diff --git a/driver_navcom.c b/driver_navcom.c
index c0a79d6e..bc2083ce 100644
--- a/driver_navcom.c
+++ b/driver_navcom.c
@@ -1120,14 +1120,13 @@ gps_mask_t navcom_parse(struct gps_device_t * session, unsigned char *buf,
size_t len)
{
unsigned char cmd_id;
- unsigned char *payload;
unsigned int msg_len;
if (len == 0)
return 0;
cmd_id = (unsigned char)getub(buf, 3);
- payload = &buf[6];
+ //payload = &buf[6];
msg_len = (uint) getleu16(buf, 4);
/*@ -usedef -compdef @*/
diff --git a/driver_nmea.c b/driver_nmea.c
index ec29f197..90746ce6 100644
--- a/driver_nmea.c
+++ b/driver_nmea.c
@@ -269,7 +269,7 @@ static gps_mask_t processGPGLL(int count, char *field[],
}
}
if (strcmp(field[6], "A") == 0 && (count < 8 || *status != 'N')) {
- int newstatus = session->gpsdata.status;
+ int newstatus;
do_lat_lon(&field[1], &session->newdata);
mask |= LATLON_SET;
diff --git a/libgps_json.c b/libgps_json.c
index e327325d..ecc8e141 100644
--- a/libgps_json.c
+++ b/libgps_json.c
@@ -80,6 +80,7 @@ static int json_tpv_read(const char *buf, struct gps_data_t *gpsdata,
};
/*@ +fullinitblock @*/
+ tbuf[0] = '\0';
status = json_read_object(buf, json_attrs_1, endptr);
if (status == 0) {
@@ -161,6 +162,7 @@ static int json_noise_read(const char *buf, struct gps_data_t *gpsdata,
};
/*@ +fullinitblock @*/
+ tbuf[0] = '\0';
status = json_read_object(buf, json_attrs_1, endptr);
if (status != 0)
return status;
@@ -234,6 +236,7 @@ static int json_sky_read(const char *buf, struct gps_data_t *gpsdata,
usedflags[i] = false;
}
+ tbuf[0] = '\0';
status = json_read_object(buf, json_attrs_2, endptr);
if (status != 0)
return status;
diff --git a/net_ntrip.c b/net_ntrip.c
index 690c322c..53285caa 100644
--- a/net_ntrip.c
+++ b/net_ntrip.c
@@ -436,7 +436,7 @@ int ntrip_open(struct gps_device_t *device, char *caster)
char *port = NULL;
char *stream = NULL;
char *url = NULL;
- int ret;
+ int ret = -1;
char t[strlen(caster + 1)];
char *tmp = t;