summaryrefslogtreecommitdiff
path: root/lib/libproc
diff options
context:
space:
mode:
authorBrooks Davis <brooks@FreeBSD.org>2019-07-22 18:27:17 +0000
committerBrooks Davis <brooks@FreeBSD.org>2019-07-22 18:27:17 +0000
commit41fc64c259fc338ccbdddd9f730440f40fce6767 (patch)
tree54be927a5be90ce840bbe3aaf34c144bae6666ba /lib/libproc
parentf1903dc0550e4cd857e6ae2cabe135a6c59d39dc (diff)
downloadsrc-test-41fc64c259fc338ccbdddd9f730440f40fce6767.tar.gz
src-test-41fc64c259fc338ccbdddd9f730440f40fce6767.zip
Be consistent about temporary variable use in adjacent loops.
Obtained from: CheriBSD MFC after: 1 week Sponsored by: DARPA, AFRL
Notes
Notes: svn path=/head/; revision=350218
Diffstat (limited to 'lib/libproc')
-rw-r--r--lib/libproc/proc_sym.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libproc/proc_sym.c b/lib/libproc/proc_sym.c
index 5901379b1582c..c3a84a9403a20 100644
--- a/lib/libproc/proc_sym.c
+++ b/lib/libproc/proc_sym.c
@@ -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,