]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
last: use as narrow variable scoping as possible
authorSami Kerola <kerolasa@iki.fi>
Sat, 17 Aug 2013 18:15:17 +0000 (19:15 +0100)
committerKarel Zak <kzak@redhat.com>
Fri, 23 Aug 2013 08:59:02 +0000 (10:59 +0200)
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
login-utils/last.c

index 63055a7818f5e027a11acf81e75efb01c8a651ee..e94f1f038ecfb0f0526a84af3dafe291cf9b214d 100644 (file)
@@ -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 ||