summaryrefslogtreecommitdiffstats
path: root/sys-utils/rtcwake.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/rtcwake.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/rtcwake.c')
-rw-r--r--sys-utils/rtcwake.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys-utils/rtcwake.c b/sys-utils/rtcwake.c
index 053baf5ef..536c5bf5c 100644
--- a/sys-utils/rtcwake.c
+++ b/sys-utils/rtcwake.c
@@ -344,18 +344,18 @@ static int print_alarm(struct rtcwake_control *ctl, int fd)
return 0;
}
-static int get_rtc_mode(struct rtcwake_control *ctl, const char *optarg)
+static int get_rtc_mode(struct rtcwake_control *ctl, const char *s)
{
size_t i;
char **modes = get_sys_power_states(ctl), **m;
STRV_FOREACH(m, modes) {
- if (strcmp(optarg, *m) == 0)
+ if (strcmp(s, *m) == 0)
return SYSFS_MODE;
}
for (i = 0; i < ARRAY_SIZE(rtcwake_mode_string); i++)
- if (!strcmp(optarg, rtcwake_mode_string[i]))
+ if (!strcmp(s, rtcwake_mode_string[i]))
return i;
return -EINVAL;