[PATCH 12/16] last: use as narrow variable scoping as possible

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Sami Kerola <kerolasa@xxxxxx>
---
 login-utils/last.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/login-utils/last.c b/login-utils/last.c
index 63055a7..e94f1f0 100644
--- a/login-utils/last.c
+++ b/login-utils/last.c
@@ -259,7 +259,7 @@ static int list(struct utmp *p, time_t t, int what)
 	char		final[512];
 	char		utline[UT_LINESIZE+1];
 	char		domain[256];
-	char		*s, **walk;
+	char		*s;
 	int		mins, hours, days;
 	int		r, len;
 
@@ -277,6 +277,7 @@ static int list(struct utmp *p, time_t t, int what)
 	 *	Is this something we wanna show?
 	 */
 	if (show) {
+		char **walk;
 		for (walk = show; *walk; walk++) {
 			if (strncmp(p->ut_name, *walk, UT_NAMESIZE) == 0 ||
 			    strcmp(utline, *walk) == 0 ||
-- 
1.8.3.4

--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux