summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bsnmpd
diff options
context:
space:
mode:
authorngie <ngie@FreeBSD.org>2016-05-14 20:58:34 +0000
committerngie <ngie@FreeBSD.org>2016-05-14 20:58:34 +0000
commit7cc1c163268294eb7fcad6fc984ca43f3f9a0206 (patch)
treeee35008e4f24e5b67d46d2489a30efe429f26712 /usr.sbin/bsnmpd
parent22b898e4cfc7d39ffaad5c5fbda6578932fc3c53 (diff)
downloadFreeBSD-src-7cc1c163268294eb7fcad6fc984ca43f3f9a0206.zip
FreeBSD-src-7cc1c163268294eb7fcad6fc984ca43f3f9a0206.tar.gz
Mute -Wstrlcpy-strlcat-size warning by using nitems with the size of the buffer
This is a no-op as the malloc above set the size of the buffer to the size used below, but this keeps things consistent in case the malloc call changes somehow. MFC after: 1 week Reported by: clang Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'usr.sbin/bsnmpd')
-rw-r--r--usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c b/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c
index de5a60b..2d3099e 100644
--- a/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c
+++ b/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c
@@ -774,7 +774,7 @@ snmp_import_object(struct snmp_toolinfo *snmptoolctx)
return (-1);
}
- strlcpy(string, nexttok, strlen(nexttok) + 1);
+ strlcpy(string, nexttok, nitems(string));
oid2str->string = string;
oid2str->strlen = strlen(nexttok);
OpenPOWER on IntegriCloud