svn commit: r295238 - user/ngie/bsnmp_cleanup/usr.sbin/bsnmpd/tools/libbsnmptools
Garrett Cooper
ngie at FreeBSD.org
Thu Feb 4 08:17:36 UTC 2016
Author: ngie
Date: Thu Feb 4 08:17:35 2016
New Revision: 295238
URL: https://svnweb.freebsd.org/changeset/base/295238
Log:
- Mark `snmptoolctx` __unused in
parse_{authentication,context,privacy,user_security}(..) to fix -Wunused
- Cast `count` to size_t to fix a -Wsign-compare warning as `count` is
signed by definition
Reported by: clang 3.7.2, gcc 4.9.4
Modified:
user/ngie/bsnmp_cleanup/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c
Modified: user/ngie/bsnmp_cleanup/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c
==============================================================================
--- user/ngie/bsnmp_cleanup/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Thu Feb 4 08:15:17 2016 (r295237)
+++ user/ngie/bsnmp_cleanup/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Thu Feb 4 08:17:35 2016 (r295238)
@@ -468,7 +468,7 @@ parse_ascii(char *ascii, uint8_t *binstr
return (-1);
}
binstr[count] = (uint8_t) val;
- if (++count >= binlen) {
+ if ((size_t)++count >= binlen) {
warnx("Key %s too long - truncating to %zu octets",
ascii, binlen);
break;
@@ -483,7 +483,7 @@ parse_ascii(char *ascii, uint8_t *binstr
* snmp_client structure.
*/
int32_t
-parse_authentication(struct snmp_toolinfo *snmptoolctx, char *opt_arg)
+parse_authentication(struct snmp_toolinfo *snmptoolctx __unused, char *opt_arg)
{
int32_t count, subopt;
char *val, *option;
@@ -538,7 +538,7 @@ parse_authentication(struct snmp_toolinf
}
int32_t
-parse_privacy(struct snmp_toolinfo *snmptoolctx, char *opt_arg)
+parse_privacy(struct snmp_toolinfo *snmptoolctx __unused, char *opt_arg)
{
int32_t count, subopt;
char *val, *option;
@@ -591,7 +591,7 @@ parse_privacy(struct snmp_toolinfo *snmp
}
int32_t
-parse_context(struct snmp_toolinfo *snmptoolctx, char *opt_arg)
+parse_context(struct snmp_toolinfo *snmptoolctx __unused, char *opt_arg)
{
int32_t count, subopt;
char *val, *option;
@@ -633,7 +633,7 @@ parse_context(struct snmp_toolinfo *snmp
}
int32_t
-parse_user_security(struct snmp_toolinfo *snmptoolctx, char *opt_arg)
+parse_user_security(struct snmp_toolinfo *snmptoolctx __unused, char *opt_arg)
{
int32_t count, subopt, saved_errno;
char *val, *option;
More information about the svn-src-user
mailing list