From: "cron2 (Code Review)" Date: Fri, 11 Aug 2023 14:52:51 +0000 In-Reply-To: References: Reply-To: arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <882978641c96477f108b1c7397b5a36901ea9f5d-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="pwE0CJVEGWM="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: options: Do not hide variables from parent scope List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: flichtenheld Cc: plaisthos , openvpn-devel --pwE0CJVEGWM= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/32= 0?usp=3Demail ) Change subject: options: Do not hide variables from parent scope ...................................................................... options: Do not hide variables from parent scope 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 Acked-by: Lev Stipakov Message-Id: URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg26= 902.html Signed-off-by: Gert Doering --- M src/openvpn/options.c 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/openvpn/options.c b/src/openvpn/options.c index 90d85be..d168163 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -9476,24 +9476,24 @@ else { int i; - int msglevel =3D msglevel_fc; + int msglevel_unknown =3D msglevel_fc; /* Check if an option is in --ignore-unknown-option and * set warning level to non fatal */ for (i =3D 0; options->ignore_unknown_option && options->ignore_un= known_option[i]; i++) { if (streq(p[0], options->ignore_unknown_option[i])) { - msglevel =3D M_WARN; + msglevel_unknown =3D M_WARN; break; } } if (file) { - msg(msglevel, "Unrecognized option or missing or extra paramet= er(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 paramet= er(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: -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/320?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I9f9d0f0d5ab03f8cdfd7ba7200f2d56613cc586d Gerrit-Change-Number: 320 Gerrit-PatchSet: 2 Gerrit-Owner: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-MessageType: merged --pwE0CJVEGWM= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 submitted this change.

View Change

options: Do not hide variables from parent sco=
pe

msglevel hides the function parameter of the same name,
which = could lead to confusion. Use a unique name.

Change-Id: I9f9d0f0d5ab0= 3f8cdfd7ba7200f2d56613cc586d
Signed-off-by: Frank Lichtenheld <frank@= ...2641...>
Acked-by: Lev Stipakov <lstipakov@...277...>
Mes= sage-Id: <d549c9b5e5d66624ef82f99206898ff8e43a5fb5-HTML@...2715...>URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg= 26902.html
Signed-off-by: Gert Doering <gert@...1296...>
---M src/openvpn/options.c
1 file changed, 4 insertions(+), 4 deletions(-)=

diff --git a/src/openvpn/options.c b/src/openvpn/options.c
index 90d85be..d168163 100644
--- a/src/openvpn/options.= c
+++ b/src/openvpn/options.c
@@ -9476,24 += 9476,24 @@
else
{
int i;
- = int msglevel =3D msglevel_fc;
+ int msglevel_unknown =3D msglevel_fc;
= /* Check if an option is in --ignore-unknown-option and
= * set warning level to non fatal */
= for (i =3D 0; options->ignore_unknown_option && options->ig= nore_unknown_option[i]; i++)
{
= if (streq(p[0], options->ignore_unknown_option[i]))
= {
- = msglevel =3D M_WARN;
+ msglevel_unknown =3D 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, "Unrecogniz= ed option or missing or extra parameter(s) in %s:%d: %s (%s)", file, l= ine, p[0], PACKAGE_VERSION);
}
= else
{
- msg(msglevel, "Unrecognized option or miss= ing or extra parameter(s): --%s (%s)", p[0], PACKAGE_VERSION);<= br>+ msg(msglevel_un= known, "Unrecognized option or missing or extra parameter(s): --%s (%s= )", p[0], PACKAGE_VERSION);
}
}
err:

To view, = visit cha= nge 320. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I9f9d0f0d5ab03f8cdfd7ba7200f= 2d56613cc586d
Gerrit-Change-Number: 320
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-MessageType: merged
--pwE0CJVEGWM=--