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 */
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to