Author: ngie
Date: Sat May 14 20:58:34 2016
New Revision: 299763
URL: https://svnweb.freebsd.org/changeset/base/299763

Log:
  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

Modified:
  head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c

Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c
==============================================================================
--- head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c      Sat May 14 
20:33:42 2016        (r299762)
+++ head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmpimport.c      Sat May 14 
20:58:34 2016        (r299763)
@@ -774,7 +774,7 @@ snmp_import_object(struct snmp_toolinfo 
                return (-1);
        }
 
-       strlcpy(string, nexttok, strlen(nexttok) + 1);
+       strlcpy(string, nexttok, nitems(string));
        oid2str->string = string;
        oid2str->strlen = strlen(nexttok);
 
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to