From eb2306e675d9ba5e348938e473f5a6f96400980f Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Sun, 3 Jul 2016 13:20:30 +0100 Subject: misc: fix declarations shadowing variables in the global scope [oclint] Fixes multiple occurences of 'optarg' overwrites. Signed-off-by: Sami Kerola --- login-utils/lslogins.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'login-utils/lslogins.c') diff --git a/login-utils/lslogins.c b/login-utils/lslogins.c index 60a1b500f..76ada7fd2 100644 --- a/login-utils/lslogins.c +++ b/login-utils/lslogins.c @@ -1200,7 +1200,7 @@ static void free_user(void *f) free(u); } -static int parse_time_mode(const char *optarg) +static int parse_time_mode(const char *s) { struct lslogins_timefmt { const char *name; @@ -1214,10 +1214,10 @@ static int parse_time_mode(const char *optarg) size_t i; for (i = 0; i < ARRAY_SIZE(timefmts); i++) { - if (strcmp(timefmts[i].name, optarg) == 0) + if (strcmp(timefmts[i].name, s) == 0) return timefmts[i].val; } - errx(EXIT_FAILURE, _("unknown time format: %s"), optarg); + errx(EXIT_FAILURE, _("unknown time format: %s"), s); } static void __attribute__((__noreturn__)) usage(FILE *out) -- cgit v1.2.3-55-g7522