summaryrefslogtreecommitdiffstats
path: root/sys-utils/dmesg.c
diff options
context:
space:
mode:
authorSami Kerola2016-07-03 14:20:30 +0200
committerSami Kerola2016-07-21 22:14:33 +0200
commiteb2306e675d9ba5e348938e473f5a6f96400980f (patch)
tree7de284185f9bc7845e322d5db98ec29036a1c11d /sys-utils/dmesg.c
parentdmesg: drop core at impossible case in read_buffer() [oclint] (diff)
downloadkernel-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 'sys-utils/dmesg.c')
-rw-r--r--sys-utils/dmesg.c14
1 files changed, 7 insertions, 7 deletions
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