diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2016-03-28 16:32:36 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2016-03-28 16:32:36 -0400 |
commit | e44410df8283326eddacc5a2331613ab704d586f (patch) | |
tree | 3472a71543e1cdede9db153beca39c491060f591 | |
parent | e1f37d8f135cce21deed20da2395aea18bf8ef00 (diff) | |
download | gpsd-e44410df8283326eddacc5a2331613ab704d586f.tar.gz |
Coverity cleanup.
-rw-r--r-- | driver_nmea2000.c | 2 | ||||
-rw-r--r-- | ppsthread.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/driver_nmea2000.c b/driver_nmea2000.c index 6f938e00..c5c6a8b1 100644 --- a/driver_nmea2000.c +++ b/driver_nmea2000.c @@ -1701,7 +1701,7 @@ int nmea2000_open(struct gps_device_t *session) session->driver.nmea2000.unit = unit_number; session->driver.nmea2000.unit_valid = true; } else { - strncpy(can_interface_name[can_net], + strlcpy(can_interface_name[can_net], interface_name, MIN(sizeof(can_interface_name[0]), sizeof(interface_name))); session->driver.nmea2000.unit_valid = false; diff --git a/ppsthread.c b/ppsthread.c index dfb55be5..b0b5303a 100644 --- a/ppsthread.c +++ b/ppsthread.c @@ -190,7 +190,7 @@ static int init_kernel_pps(struct inner_context_t *inner_context) * strlcpy() is not available.) */ if (strncmp(pps_thread->devicename, "/dev/pps", 8) == 0) - (void)strncpy(path, pps_thread->devicename, sizeof(path)); + (void)strncpy(path, pps_thread->devicename, sizeof(path)-1); else { char pps_num = '\0'; /* /dev/pps[pps_num] is our device */ size_t i; /* to match type of globbuf.gl_pathc */ |