summaryrefslogtreecommitdiffstats
path: root/misc-utils/logger.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 /misc-utils/logger.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 'misc-utils/logger.c')
-rw-r--r--misc-utils/logger.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/misc-utils/logger.c b/misc-utils/logger.c
index dbb9cdc24..4fb650a42 100644
--- a/misc-utils/logger.c
+++ b/misc-utils/logger.c
@@ -804,11 +804,11 @@ static void syslog_rfc5424_header(struct logger_ctl *const ctl)
free(structured);
}
-static void parse_rfc5424_flags(struct logger_ctl *ctl, char *optarg)
+static void parse_rfc5424_flags(struct logger_ctl *ctl, char *s)
{
char *in, *tok;
- in = optarg;
+ in = s;
while ((tok = strtok(in, ","))) {
in = NULL;
if (!strcmp(tok, "notime")) {
@@ -823,15 +823,15 @@ static void parse_rfc5424_flags(struct logger_ctl *ctl, char *optarg)
}
}
-static int parse_unix_socket_errors_flags(char *optarg)
+static int parse_unix_socket_errors_flags(char *s)
{
- if (!strcmp(optarg, "off"))
+ if (!strcmp(s, "off"))
return AF_UNIX_ERRORS_OFF;
- if (!strcmp(optarg, "on"))
+ if (!strcmp(s, "on"))
return AF_UNIX_ERRORS_ON;
- if (!strcmp(optarg, "auto"))
+ if (!strcmp(s, "auto"))
return AF_UNIX_ERRORS_AUTO;
- warnx(_("invalid argument: %s: using automatic errors"), optarg);
+ warnx(_("invalid argument: %s: using automatic errors"), s);
return AF_UNIX_ERRORS_AUTO;
}