aboutsummaryrefslogtreecommitdiff
path: root/src/libndb
diff options
context:
space:
mode:
authorNeven Sajko <nsajko@gmail.com>2020-01-06 22:57:05 +0000
committerDan Cross <crossd@gmail.com>2020-01-07 16:23:40 -0500
commite6ed10f25e4b2ea791d8e52253f7d806316420e9 (patch)
tree56951dd1bf82dc08bceed1abd00447b545cb9a08 /src/libndb
parent540caa5873bcc3bc2a0e1896119f5b53a0e8e630 (diff)
downloadplan9port-e6ed10f25e4b2ea791d8e52253f7d806316420e9.tar.gz
plan9port-e6ed10f25e4b2ea791d8e52253f7d806316420e9.tar.bz2
plan9port-e6ed10f25e4b2ea791d8e52253f7d806316420e9.zip
lib9, libndb: exclude terminating null from strncpy bound
GCC pointed this out with some "warning: ‘strncpy’ specified bound NUM equals destination size [-Wstringop-truncation]" warnings. Change-Id: Id8408b165f6e4ae82c96a77599d89f658d979b32
Diffstat (limited to 'src/libndb')
-rw-r--r--src/libndb/sysdnsquery.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libndb/sysdnsquery.c b/src/libndb/sysdnsquery.c
index b9661be1..0a771e2b 100644
--- a/src/libndb/sysdnsquery.c
+++ b/src/libndb/sysdnsquery.c
@@ -84,7 +84,7 @@ mkptrname(char *ip, char *rip, int rlen)
static void
nstrcpy(char *to, char *from, int len)
{
- strncpy(to, from, len);
+ strncpy(to, from, len-1);
to[len-1] = 0;
}