Use the size of the destination buffer, not the source buffer.

Technically this is a no-op, but mute the clang warning in case the malloc call
above for fstring ever changes in the future

Reported by: clang
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
This commit is contained in:
Enji Cooper 2016-05-14 21:27:33 +00:00
parent 6e229b2973
commit 78a780e3e5

View File

@ -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, strlen(filename) + 1);
strlcpy(fstring, filename, sizeof(fstring));
entry->name = fstring;
entry->done = done;
SLIST_INSERT_HEAD(&snmptoolctx->filelist, entry, link);