diff options
author | Sami Kerola | 2016-07-03 14:20:30 +0200 |
---|---|---|
committer | Sami Kerola | 2016-07-21 22:14:33 +0200 |
commit | eb2306e675d9ba5e348938e473f5a6f96400980f (patch) | |
tree | 7de284185f9bc7845e322d5db98ec29036a1c11d /login-utils | |
parent | dmesg: drop core at impossible case in read_buffer() [oclint] (diff) | |
download | kernel-qcow2-util-linux-eb2306e675d9ba5e348938e473f5a6f96400980f.tar.gz kernel-qcow2-util-linux-eb2306e675d9ba5e348938e473f5a6f96400980f.tar.xz kernel-qcow2-util-linux-eb2306e675d9ba5e348938e473f5a6f96400980f.zip |
misc: fix declarations shadowing variables in the global scope [oclint]
Fixes multiple occurences of 'optarg' overwrites.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'login-utils')
-rw-r--r-- | login-utils/last.c | 6 | ||||
-rw-r--r-- | login-utils/lslogins.c | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/login-utils/last.c b/login-utils/last.c index 0c234f5e4..6d0e8920a 100644 --- a/login-utils/last.c +++ b/login-utils/last.c @@ -163,15 +163,15 @@ static time_t lastdate; /* Last date we've seen */ static time_t currentdate; /* date when we started processing the file */ /* --time-format=option parser */ -static int which_time_format(const char *optarg) +static int which_time_format(const char *s) { 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 i; } - errx(EXIT_FAILURE, _("unknown time format: %s"), optarg); + errx(EXIT_FAILURE, _("unknown time format: %s"), s); } /* 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) |