Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 Aug 2019 20:24:04 +0000 (UTC)
From:      Brooks Davis <brooks@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r350542 - stable/12/lib/libproc
Message-ID:  <201908022024.x72KO42P011577@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: brooks
Date: Fri Aug  2 20:24:04 2019
New Revision: 350542
URL: https://svnweb.freebsd.org/changeset/base/350542

Log:
  MFC r350218:
  
  Be consistent about temporary variable use in adjacent loops.
  
  Obtained from:	CheriBSD
  Sponsored by:	DARPA, AFRL

Modified:
  stable/12/lib/libproc/proc_sym.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/lib/libproc/proc_sym.c
==============================================================================
--- stable/12/lib/libproc/proc_sym.c	Fri Aug  2 20:16:21 2019	(r350541)
+++ stable/12/lib/libproc/proc_sym.c	Fri Aug  2 20:24:04 2019	(r350542)
@@ -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?201908022024.x72KO42P011577>