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 --- sys-utils/dmesg.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'sys-utils/dmesg.c') diff --git a/sys-utils/dmesg.c b/sys-utils/dmesg.c index 92de6e26f..a2ab3a2e3 100644 --- a/sys-utils/dmesg.c +++ b/sys-utils/dmesg.c @@ -1178,19 +1178,19 @@ static int read_kmsg(struct dmesg_control *ctl) return 0; } -static int which_time_format(const char *optarg) +static int which_time_format(const char *s) { - if (!strcmp(optarg, "notime")) + if (!strcmp(s, "notime")) return DMESG_TIMEFTM_NONE; - if (!strcmp(optarg, "ctime")) + if (!strcmp(s, "ctime")) return DMESG_TIMEFTM_CTIME; - if (!strcmp(optarg, "delta")) + if (!strcmp(s, "delta")) return DMESG_TIMEFTM_DELTA; - if (!strcmp(optarg, "reltime")) + if (!strcmp(s, "reltime")) return DMESG_TIMEFTM_RELTIME; - if (!strcmp(optarg, "iso")) + if (!strcmp(s, "iso")) return DMESG_TIMEFTM_ISO8601; - errx(EXIT_FAILURE, _("unknown time format: %s"), optarg); + errx(EXIT_FAILURE, _("unknown time format: %s"), s); } #ifdef TEST_DMESG -- cgit v1.2.3-55-g7522