From: Sami Kerola Date: Sat, 17 Aug 2013 18:15:17 +0000 (+0100) Subject: last: use as narrow variable scoping as possible X-Git-Tag: v2.24-rc1~336 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=328734c04860ded2750fbf0b85d2acb9d0a5e0c9;p=thirdparty%2Futil-linux.git last: use as narrow variable scoping as possible Signed-off-by: Sami Kerola --- diff --git a/login-utils/last.c b/login-utils/last.c index 63055a7818..e94f1f038e 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 ||