svn commit: r354834 - head/contrib/bsnmp/lib

Justin Hibbits jhibbits at FreeBSD.org
Mon Nov 18 23:23:39 UTC 2019


Author: jhibbits
Date: Mon Nov 18 23:23:38 2019
New Revision: 354834
URL: https://svnweb.freebsd.org/changeset/base/354834

Log:
  bsnmp: Fix operator precedence in error check in table_check_response
  
  Summary:
  The ?: operator has a lower precedence than == and &&, so the result will always
  be recorded as true.  Found by gcc8.
  
  Reviewed by:	ngie, ae
  Differential Revision: https://reviews.freebsd.org/D22427

Modified:
  head/contrib/bsnmp/lib/snmpclient.c

Modified: head/contrib/bsnmp/lib/snmpclient.c
==============================================================================
--- head/contrib/bsnmp/lib/snmpclient.c	Mon Nov 18 23:21:13 2019	(r354833)
+++ head/contrib/bsnmp/lib/snmpclient.c	Mon Nov 18 23:23:38 2019	(r354834)
@@ -480,7 +480,7 @@ table_check_response(struct tabwork *work, const struc
 		if (snmp_client.version == SNMP_V1 &&
 		    resp->error_status == SNMP_ERR_NOSUCHNAME &&
 		    resp->error_index ==
-		    (work->descr->last_change.len == 0) ? 1 : 2)
+		    ((work->descr->last_change.len == 0) ? 1 : 2))
 			/* EOT */
 			return (0);
 		/* Error */


More information about the svn-src-all mailing list