diff options
author | ngie <ngie@FreeBSD.org> | 2016-05-14 22:43:07 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2016-05-14 22:43:07 +0000 |
commit | fe72dd1b411d4a3344d64b7e90ab0fbaff92829e (patch) | |
tree | 73a1fef32310331c12bf7dbedcd32f5ea9b78f30 /usr.sbin | |
parent | 78ec2149ecb3e0845ce3724d24712b6c349866b0 (diff) | |
download | FreeBSD-src-fe72dd1b411d4a3344d64b7e90ab0fbaff92829e.zip FreeBSD-src-fe72dd1b411d4a3344d64b7e90ab0fbaff92829e.tar.gz |
Fix up r299764
I meant to use nitems, not sizeof(..) with the destination buffer. Using sizeof(..)
on a pointer will always truncate the output in the destination buffer incorrectly
Pointyhat to: ngie
MFC after: 1 week
X-MFC with: r299764
Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c b/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c index c2fe4b4..ed81e73 100644 --- a/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c +++ b/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c @@ -264,7 +264,7 @@ add_filename(struct snmp_toolinfo *snmptoolctx, const char *filename, if (cut != NULL) asn_append_oid(&(entry->cut), cut); - strlcpy(fstring, filename, sizeof(fstring)); + strlcpy(fstring, filename, nitems(fstring)); entry->name = fstring; entry->done = done; SLIST_INSERT_HEAD(&snmptoolctx->filelist, entry, link); |