From: "flichtenheld (Code Review)" Date: Fri, 28 Jul 2023 13:03:31 +0000 References: Reply-To: frank@...2641..., openvpn-devel@lists.sourceforge.net Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="17yJ/RvFRA0="; 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: , Cc: openvpn-devel --17yJ/RvFRA0= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable flichtenheld has uploaded this change for review. ( http://gerrit.openvpn.n= et/c/openvpn/+/320?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 --- M src/openvpn/options.c 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/20/320/1 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: 1 Gerrit-Owner: flichtenheld Gerrit-CC: openvpn-devel Gerrit-MessageType: newchange --17yJ/RvFRA0= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

flichtenheld has uploaded this change for review.

View Cha= nge

options: Do not hide variables from parent scope

msglevel hi= des the function parameter of the same name,
which could lead to confusi= on. Use a unique name.

Change-Id: I9f9d0f0d5ab03f8cdfd7ba7200f2d5661= 3cc586d
Signed-off-by: Frank Lichtenheld <frank@...2641...>
---=
M src/openvpn/options.c
1 file changed, 4 insertions(+), 4 deletions= (-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/=
20/320/1
diff --git a/src/openvpn/options.c b/src/openvpn/options.c=

index 90d85be..d168163 100644
--- a/src/op= envpn/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_unknown_option[i]; i++)
{

if (streq(p[0], options->ignore_unknown_option[i= ]))
{
- msglevel =3D M_WARN;
+ msglevel_unknown =3D M_WARN;<= /span>
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, &q= uot;Unrecognized option or missing or extra parameter(s) in %s:%d: %s (%s)&= quot;, file, line, p[0], PACKAGE_VERSION);
}
else
{
- msg(msglevel, "Unrecognize= d option or missing or extra parameter(s): --%s (%s)", p[0], PACKAGE_V= ERSION);
+ = msg(msglevel_unknown, "Unrecognized option or missing or extra parame= ter(s): --%s (%s)", p[0], PACKAGE_VERSION);
}=
}
err:

To view, visit change 320. To unsubscribe, or for help writing mail filte= rs, visit settings.

<= div itemscope itemtype=3D"http://schema.org/EmailMessage">
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I9f9d0f0d5ab03f8cdfd7ba7200f= 2d56613cc586d
Gerrit-Change-Number: 320
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-MessageType: newchange
--17yJ/RvFRA0=--