Skip to content

Commit

Permalink
Be consistent about temporary variable use in adjacent loops.
Browse files Browse the repository at this point in the history
Obtained from:	CheriBSD
MFC after:	1 week
Sponsored by:	DARPA, AFRL
  • Loading branch information
brooksdavis committed Jul 22, 2019
1 parent 79ab72b commit efd664a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/libproc/proc_sym.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit efd664a

Please sign in to comment.