Skip to content

Commit

Permalink
options: Do not hide variables from parent scope
Browse files Browse the repository at this point in the history
msglevel hides the function parameter of the same name,
which could lead to confusion. Use a unique name.

Change-Id: I9f9d0f0d5ab03f8cdfd7ba7200f2d56613cc586d
Signed-off-by: Frank Lichtenheld <[email protected]>
Acked-by: Lev Stipakov <[email protected]>
Message-Id: <[email protected]>
URL: https://www.mail-archive.com/[email protected]/msg26902.html
Signed-off-by: Gert Doering <[email protected]>
(cherry picked from commit f7c8cc0)
  • Loading branch information
flichtenheld authored and cron2 committed Aug 11, 2023
1 parent 64a75e7 commit 4b4f6ff
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/openvpn/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -9478,24 +9478,24 @@ add_option(struct options *options,
else
{
int i;
int msglevel = msglevel_fc;
int msglevel_unknown = msglevel_fc;
/* Check if an option is in --ignore-unknown-option and
* set warning level to non fatal */
for (i = 0; options->ignore_unknown_option && options->ignore_unknown_option[i]; i++)
{
if (streq(p[0], options->ignore_unknown_option[i]))
{
msglevel = M_WARN;
msglevel_unknown = M_WARN;
break;
}
}
if (file)
{
msg(msglevel, "Unrecognized option or missing or extra parameter(s) in %s:%d: %s (%s)", file, line, p[0], PACKAGE_VERSION);
msg(msglevel_unknown, "Unrecognized option or missing or extra parameter(s) in %s:%d: %s (%s)", file, line, p[0], PACKAGE_VERSION);
}
else
{
msg(msglevel, "Unrecognized option or missing or extra parameter(s): --%s (%s)", p[0], PACKAGE_VERSION);
msg(msglevel_unknown, "Unrecognized option or missing or extra parameter(s): --%s (%s)", p[0], PACKAGE_VERSION);
}
}
err:
Expand Down

0 comments on commit 4b4f6ff

Please sign in to comment.