From owner-svn-src-all@freebsd.org Mon Nov 18 23:23:39 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7F2281CC002; Mon, 18 Nov 2019 23:23:39 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47H4lH2Qqdz4g3h; Mon, 18 Nov 2019 23:23:39 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 36AE1158A; Mon, 18 Nov 2019 23:23:39 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xAINNdkr021023; Mon, 18 Nov 2019 23:23:39 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xAINNdsg021022; Mon, 18 Nov 2019 23:23:39 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201911182323.xAINNdsg021022@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 18 Nov 2019 23:23:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354834 - head/contrib/bsnmp/lib X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/contrib/bsnmp/lib X-SVN-Commit-Revision: 354834 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Nov 2019 23:23:39 -0000 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 */