From owner-svn-src-all@freebsd.org Mon Jul 22 18:27:18 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 392C0B8686; Mon, 22 Jul 2019 18:27:18 +0000 (UTC) (envelope-from brooks@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 1AAFA83EE9; Mon, 22 Jul 2019 18:27:18 +0000 (UTC) (envelope-from brooks@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 E8AAB193E6; Mon, 22 Jul 2019 18:27:17 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x6MIRH2D055740; Mon, 22 Jul 2019 18:27:17 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x6MIRH79055739; Mon, 22 Jul 2019 18:27:17 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201907221827.x6MIRH79055739@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 22 Jul 2019 18:27:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350218 - head/lib/libproc X-SVN-Group: head X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: head/lib/libproc X-SVN-Commit-Revision: 350218 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1AAFA83EE9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] 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, 22 Jul 2019 18:27:18 -0000 Author: brooks Date: Mon Jul 22 18:27:17 2019 New Revision: 350218 URL: https://svnweb.freebsd.org/changeset/base/350218 Log: Be consistent about temporary variable use in adjacent loops. Obtained from: CheriBSD MFC after: 1 week Sponsored by: DARPA, AFRL Modified: head/lib/libproc/proc_sym.c Modified: head/lib/libproc/proc_sym.c ============================================================================== --- head/lib/libproc/proc_sym.c Mon Jul 22 18:14:34 2019 (r350217) +++ head/lib/libproc/proc_sym.c Mon Jul 22 18:27:17 2019 (r350218) @@ -559,10 +559,11 @@ _proc_name2map(struct proc_handle *p, const char *name } /* If we didn't find a match, try matching prefixes of the basename. */ for (i = 0; i < p->nmappings; i++) { - strlcpy(path, p->mappings[i].map.pr_mapname, sizeof(path)); + mapping = &p->mappings[i]; + strlcpy(path, mapping->map.pr_mapname, sizeof(path)); base = basename(path); if (strncmp(base, name, len) == 0) - return (&p->mappings[i]); + return (mapping); } if (strcmp(name, "a.out") == 0) return (_proc_addr2map(p,