Date: Mon, 22 Jul 2019 18:27:17 +0000 (UTC) From: Brooks Davis <brooks@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350218 - head/lib/libproc Message-ID: <201907221827.x6MIRH79055739@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201907221827.x6MIRH79055739>