From: Sami Kerola Date: Sat, 19 Nov 2011 20:52:38 +0000 (+0100) Subject: last: fix few compiler warnings X-Git-Tag: v2.21-rc1~149^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5818a4aa9ee35b69130e3eb7d021ae6e53ee4c00;p=thirdparty%2Futil-linux.git last: fix few compiler warnings Calling abort() as default seems appropriate as the default should be impossible to reach. last.c:355:3: warning: switch missing default case [-Wswitch-default] And simple line removals. last.c:110:13: warning: redundant redeclaration of 'optind' [-Wredundant-decls] last.c:111:15: warning: redundant redeclaration of 'optarg' [-Wredundant-decls] Signed-off-by: Sami Kerola --- diff --git a/login-utils/last.c b/login-utils/last.c index 50afe35cbe..734730b3a0 100644 --- a/login-utils/last.c +++ b/login-utils/last.c @@ -107,8 +107,6 @@ static char *ttyconv(char *); int main(int argc, char **argv) { - extern int optind; - extern char *optarg; int ch; setlocale(LC_ALL, ""); @@ -369,7 +367,9 @@ want(struct utmp *bp, int check) { if ((in_addr_t) bp->ut_addr == inet_addr(step->name)) return YES; break; - } + default: + abort(); + } return NO; }