Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Nov 2019 23:23:39 +0000 (UTC)
From:      Justin Hibbits <jhibbits@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r354834 - head/contrib/bsnmp/lib
Message-ID:  <201911182323.xAINNdsg021022@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201911182323.xAINNdsg021022>