diff options
author | Sami Kerola | 2011-11-19 21:52:38 +0100 |
---|---|---|
committer | Sami Kerola | 2011-11-29 17:58:00 +0100 |
commit | 5818a4aa9ee35b69130e3eb7d021ae6e53ee4c00 (patch) | |
tree | 0746c3c24e583c7795e94e182e8fb46831fe4eae /login-utils/last.c | |
parent | setpwnam: remove non-ANSI definitions [smatch scan] (diff) | |
download | kernel-qcow2-util-linux-5818a4aa9ee35b69130e3eb7d021ae6e53ee4c00.tar.gz kernel-qcow2-util-linux-5818a4aa9ee35b69130e3eb7d021ae6e53ee4c00.tar.xz kernel-qcow2-util-linux-5818a4aa9ee35b69130e3eb7d021ae6e53ee4c00.zip |
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 <kerolasa@iki.fi>
Diffstat (limited to 'login-utils/last.c')
-rw-r--r-- | login-utils/last.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/login-utils/last.c b/login-utils/last.c index 50afe35cb..734730b3a 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; } |