From: "flichtenheld (Code Review)" Date: Fri, 25 Jul 2025 10:06:03 +0000 References: Reply-To: frank@...2641..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="UCRv1PdwR64="; charset=UTF-8 Subject: [Openvpn-devel] [M] Change in openvpn[master]: plugins: Clean up -Wconversion warnings List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos Cc: openvpn-devel --UCRv1PdwR64= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: plaisthos. Hello plaisthos, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/1111?usp=3Demail to review the following change. Change subject: plugins: Clean up -Wconversion warnings ...................................................................... plugins: Clean up -Wconversion warnings Most of the are actually the same ones copied to every single plugin. Some drive-by fixes of other warnings and some conversion cleanups that had no warnings because they were suppressed by casts. Change-Id: Id61df43bd79fc794a55e107daa0218c8441c2b2c Signed-off-by: Frank Lichtenheld --- M sample/sample-plugins/client-connect/sample-client-connect.c M sample/sample-plugins/defer/multi-auth.c M sample/sample-plugins/keying-material-exporter-demo/keyingmaterialexporte= r.c M sample/sample-plugins/log/log.c M sample/sample-plugins/log/log_v3.c M sample/sample-plugins/simple/base64.c M sample/sample-plugins/simple/simple.c M src/plugins/auth-pam/auth-pam.c M src/plugins/auth-pam/utils.c M src/plugins/down-root/down-root.c 10 files changed, 42 insertions(+), 54 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/11/1111/1 diff --git a/sample/sample-plugins/client-connect/sample-client-connect.c b= /sample/sample-plugins/client-connect/sample-client-connect.c index 18c2c6f..5194270 100644 --- a/sample/sample-plugins/client-connect/sample-client-connect.c +++ b/sample/sample-plugins/client-connect/sample-client-connect.c @@ -86,9 +86,8 @@ { if (envp) { - int i; - const int namelen =3D strlen(name); - for (i =3D 0; envp[i]; ++i) + const size_t namelen =3D strlen(name); + for (int i =3D 0; envp[i]; ++i) { if (!strncmp(envp[i], name, namelen)) { @@ -309,7 +308,7 @@ /* do mighty complicated work that will really take time here... */ plugin_log(PLOG_NOTE, MODULE, "in async/deferred handler, sleep(%d)", = seconds); - sleep(seconds); + sleep((unsigned int)seconds); /* write config options to openvpn */ int ret =3D write_cc_options_file(name, envp); diff --git a/sample/sample-plugins/defer/multi-auth.c b/sample/sample-plugi= ns/defer/multi-auth.c index 38db07f..c458346 100644 --- a/sample/sample-plugins/defer/multi-auth.c +++ b/sample/sample-plugins/defer/multi-auth.c @@ -124,9 +124,8 @@ { if (envp) { - int i; - const int namelen =3D strlen(name); - for (i =3D 0; envp[i]; ++i) + const size_t namelen =3D strlen(name); + for (int i =3D 0; envp[i]; ++i) { if (!strncmp(envp[i], name, namelen)) { @@ -170,7 +169,7 @@ /* Require a minimum OpenVPN Plugin API */ OPENVPN_EXPORT int -openvpn_plugin_min_version_required_v1() +openvpn_plugin_min_version_required_v1(void) { return OPENVPN_PLUGIN_VERSION_MIN; } @@ -349,9 +348,9 @@ */ /* do mighty complicated work that will really take time here... */ - plog(context, PLOG_NOTE, "in async/deferred handler, usleep(%d)", - context->test_deferred_auth*1000); - usleep(context->test_deferred_auth*1000); + useconds_t wait_time =3D (useconds_t)context->test_deferred_auth*1000; + plog(context, PLOG_NOTE, "in async/deferred handler, usleep(%u)", wait= _time); + usleep(wait_time); /* now signal success state to openvpn */ int fd =3D open(auth_control_file, O_WRONLY); diff --git a/sample/sample-plugins/keying-material-exporter-demo/keyingmate= rialexporter.c b/sample/sample-plugins/keying-material-exporter-demo/keying= materialexporter.c index cc256dd..f1f8868 100644 --- a/sample/sample-plugins/keying-material-exporter-demo/keyingmaterialexp= orter.c +++ b/sample/sample-plugins/keying-material-exporter-demo/keyingmaterialexp= orter.c @@ -69,9 +69,8 @@ { if (envp) { - int i; - const int namelen =3D strlen(name); - for (i =3D 0; envp[i]; ++i) + const size_t namelen =3D strlen(name); + for (int i =3D 0; envp[i]; ++i) { if (!strncmp(envp[i], name, namelen)) { diff --git a/sample/sample-plugins/log/log.c b/sample/sample-plugins/log/lo= g.c index 82595cf..b304f16 100644 --- a/sample/sample-plugins/log/log.c +++ b/sample/sample-plugins/log/log.c @@ -52,9 +52,8 @@ { if (envp) { - int i; - const int namelen =3D strlen(name); - for (i =3D 0; envp[i]; ++i) + const size_t namelen =3D strlen(name); + for (int i =3D 0; envp[i]; ++i) { if (!strncmp(envp[i], name, namelen)) { diff --git a/sample/sample-plugins/log/log_v3.c b/sample/sample-plugins/log= /log_v3.c index c90cc3d..a024027 100644 --- a/sample/sample-plugins/log/log_v3.c +++ b/sample/sample-plugins/log/log_v3.c @@ -55,9 +55,8 @@ { if (envp) { - int i; - const int namelen =3D strlen(name); - for (i =3D 0; envp[i]; ++i) + const size_t namelen =3D strlen(name); + for (int i =3D 0; envp[i]; ++i) { if (!strncmp(envp[i], name, namelen)) { diff --git a/sample/sample-plugins/simple/base64.c b/sample/sample-plugins/= simple/base64.c index 6855966..e1cc791 100644 --- a/sample/sample-plugins/simple/base64.c +++ b/sample/sample-plugins/simple/base64.c @@ -59,9 +59,8 @@ { if (envp) { - int i; - const int namelen =3D strlen(name); - for (i =3D 0; envp[i]; ++i) + const size_t namelen =3D strlen(name); + for (int i =3D 0; envp[i]; ++i) { if (!strncmp(envp[i], name, namelen)) { @@ -175,7 +174,7 @@ /* test the BASE64 encode function */ char *buf =3D NULL; - int r =3D ovpn_base64_encode(clcert_cn, strlen(clcert_cn), &buf); + int r =3D ovpn_base64_encode(clcert_cn, (int)strlen(clcert_cn), &buf); ovpn_log(PLOG_NOTE, PLUGIN_NAME, "BASE64 encoded '%s' (return value %i= ): '%s'", clcert_cn, r, buf); diff --git a/sample/sample-plugins/simple/simple.c b/sample/sample-plugins/= simple/simple.c index e17f3fa..2c096e2 100644 --- a/sample/sample-plugins/simple/simple.c +++ b/sample/sample-plugins/simple/simple.c @@ -54,9 +54,8 @@ { if (envp) { - int i; - const int namelen =3D strlen(name); - for (i =3D 0; envp[i]; ++i) + const size_t namelen =3D strlen(name); + for (int i =3D 0; envp[i]; ++i) { if (!strncmp(envp[i], name, namelen)) { diff --git a/src/plugins/auth-pam/auth-pam.c b/src/plugins/auth-pam/auth-pa= m.c index 8692806..7264f95 100644 --- a/src/plugins/auth-pam/auth-pam.c +++ b/src/plugins/auth-pam/auth-pam.c @@ -165,31 +165,30 @@ } } -static int -recv_string(int fd, char *buffer, int len) +static ssize_t +recv_string(int fd, char *buffer, size_t len) { if (len > 0) { - ssize_t size; memset(buffer, 0, len); - size =3D read(fd, buffer, len); + ssize_t size =3D read(fd, buffer, len); buffer[len-1] =3D 0; if (size >=3D 1) { - return (int)size; + return size; } } return -1; } -static int +static ssize_t send_string(int fd, const char *string) { - const int len =3D strlen(string) + 1; + const size_t len =3D strlen(string) + 1; const ssize_t size =3D write(fd, string, len); if (size =3D=3D len) { - return (int) size; + return size; } else { @@ -645,27 +644,26 @@ * PAM conversation function */ static int -my_conv(int n, const struct pam_message **msg_array, +my_conv(int num_msg, const struct pam_message **msg_array, struct pam_response **response_array, void *appdata_ptr) { const struct user_pass *up =3D ( const struct user_pass *) appdata_ptr; struct pam_response *aresp; - int i; int ret =3D PAM_SUCCESS; =20 *response_array =3D NULL; - if (n <=3D 0 || n > PAM_MAX_NUM_MSG) + if (num_msg <=3D 0 || num_msg > PAM_MAX_NUM_MSG) { return (PAM_CONV_ERR); } - if ((aresp =3D calloc(n, sizeof *aresp)) =3D=3D NULL) + if ((aresp =3D calloc((size_t)num_msg, sizeof *aresp)) =3D=3D NULL) { return (PAM_BUF_ERR); } /* loop through each PAM-module query */ - for (i =3D 0; i < n; ++i) + for (int i =3D 0; i < num_msg; ++i) { const struct pam_message *msg =3D msg_array[i]; aresp[i].resp_retcode =3D 0; @@ -683,9 +681,9 @@ { /* use name/value list match method */ const struct name_value_list *list =3D up->name_value_list; - int j; /* loop through name/value pairs */ + int j; /* checked after loop */ for (j =3D 0; j < list->len; ++j) { const char *match_name =3D list->data[j].name; diff --git a/src/plugins/auth-pam/utils.c b/src/plugins/auth-pam/utils.c index a6ccfbf..ab5e17e 100644 --- a/src/plugins/auth-pam/utils.c +++ b/src/plugins/auth-pam/utils.c @@ -79,7 +79,7 @@ while (scratch) { - strncat(temp, searching, scratch-searching); + strncat(temp, searching, (size_t)(scratch-searching)); strcat(temp, replacewith); searching =3D scratch+strlen(searchfor); @@ -93,9 +93,8 @@ { if (envp) { - int i; - const int namelen =3D strlen(name); - for (i =3D 0; envp[i]; ++i) + const size_t namelen =3D strlen(name); + for (int i =3D 0; envp[i]; ++i) { if (!strncmp(envp[i], name, namelen)) { diff --git a/src/plugins/down-root/down-root.c b/src/plugins/down-root/down= -root.c index 253adcd..2c0faf4 100644 --- a/src/plugins/down-root/down-root.c +++ b/src/plugins/down-root/down-root.c @@ -88,9 +88,8 @@ { if (envp) { - int i; - const int namelen =3D strlen(name); - for (i =3D 0; envp[i]; ++i) + const size_t namelen =3D strlen(name); + for (int i =3D 0; envp[i]; ++i) { if (!strncmp(envp[i], name, namelen)) { @@ -108,10 +107,10 @@ /* * Return the length of a string array */ -static int +static size_t string_array_len(const char *array[]) { - int i =3D 0; + size_t i =3D 0; if (array) { while (array[i]) @@ -141,14 +140,14 @@ } } -static int +static ssize_t send_control(int fd, int code) { unsigned char c =3D (unsigned char) code; const ssize_t size =3D write(fd, &c, sizeof(c)); if (size =3D=3D sizeof(c)) { - return (int) size; + return size; } else { @@ -281,7 +280,6 @@ openvpn_plugin_open_v1(unsigned int *type_mask, const char *argv[], const = char *envp[]) { struct down_root_context *context; - int i =3D 0; /* * Allocate our context @@ -320,7 +318,7 @@ } /* Ignore argv[0], as it contains just the plug-in file name */ - for (i =3D 1; i < string_array_len(argv); i++) + for (int i =3D 1; i < string_array_len(argv); i++) { context->command[i-1] =3D (char *) argv[i]; } -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1111?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: Id61df43bd79fc794a55e107daa0218c8441c2b2c Gerrit-Change-Number: 1111 Gerrit-PatchSet: 1 Gerrit-Owner: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-MessageType: newchange --UCRv1PdwR64= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: plaisthos.

flichtenheld would like plaisthos to review this change.

V= iew Change

plugins: Clean up -Wconversion warnings

Most of the a= re actually the same ones copied to every
single plugin.

Some dri= ve-by fixes of other warnings and some
conversion cleanups that had no w= arnings because
they were suppressed by casts.

Change-Id: Id61df4= 3bd79fc794a55e107daa0218c8441c2b2c
Signed-off-by: Frank Lichtenheld <= frank@...2641...>
---
M sample/sample-plugins/client-connect/sampl= e-client-connect.c
M sample/sample-plugins/defer/multi-auth.c
M sampl= e/sample-plugins/keying-material-exporter-demo/keyingmaterialexporter.c
= M sample/sample-plugins/log/log.c
M sample/sample-plugins/log/log_v3.cM sample/sample-plugins/simple/base64.c
M sample/sample-plugins/simple= /simple.c
M src/plugins/auth-pam/auth-pam.c
M src/plugins/auth-pam/ut= ils.c
M src/plugins/down-root/down-root.c
10 files changed, 42 insert= ions(+), 54 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/=
openvpn refs/changes/11/1111/1
diff --git a/sample/sample-plugins/c=
lient-connect/sample-client-connect.c b/sample/sample-plugins/client-connec=
t/sample-client-connect.c
index 18c2c6f..5194270 100644
--- a/sample/sample-plugins/client-connect/sample-client-conne= ct.c
+++ b/sample/sample-plugins/client-connect/sample-clie= nt-connect.c
@@ -86,9 +86,8 @@
{ if (envp)
{
- int i;
- const int namelen =3D strlen(name);
- for (i =3D 0; envp[i]; ++i)
+ const size_t = namelen =3D strlen(name);
+ for (int i =3D 0; envp[i]; ++i)
{
if (!strncmp(envp[i], name, namelen))
= {
@@ -309,7 +308,7 @@
<= /span>
/* do mighty complicated work that will really take ti= me here... */
plugin_log(PLOG_NOTE, MODULE, "in a= sync/deferred handler, sleep(%d)", seconds);
- sleep(seconds);
+ sleep((unsigned int)seconds);

/* write config options to openvpn */
<= span> int ret =3D write_cc_options_file(name, envp);

di= ff --git a/sample/sample-plugins/defer/multi-auth.c b/sample/sample-plugins= /defer/multi-auth.c
index 38db07f..c458346 100644--- a/sample/sample-plugins/defer/multi-auth.c
+++ b= /sample/sample-plugins/defer/multi-auth.c
@@ -124,9 +124,8 = @@
{
if (envp)
{=
- int i;=
- const int namelen = =3D strlen(name);
- = for (i =3D 0; envp[i]; ++i)
+ const size_t namelen =3D strlen(name);
+ for (int i =3D 0; envp[i]; += +i)
{
if (!strncmp(en= vp[i], name, namelen))
{
@@ -1= 70,7 +169,7 @@

/* Require a minimum Open= VPN Plugin API */
OPENVPN_EXPORT int
-openvpn_plugin_min_version_required_v1()
+openvpn_plugin_min_ver= sion_required_v1(void)
{
return OPENV= PN_PLUGIN_VERSION_MIN;
}
@@ -349,9 +348,9 = @@
*/

/* do mi= ghty complicated work that will really take time here... */
- plog(context, PLOG_NOTE, "in= async/deferred handler, usleep(%d)",

- context->test_deferred_auth*1000);<= br>- usleep(context->test_d= eferred_auth*1000);
+= useconds_t wait_time =3D (useconds_t)context->test_deferred_auth*100= 0;
+ plog(context,= PLOG_NOTE, "in async/deferred handler, usleep(%u)", wait_time);<= /span>
+ usleep(wait_time= );

/* now signal success state to op= envpn */
int fd =3D open(auth_control_file, O_WRONLY);=
diff --git a/sample/sample-plugins/keying-material-exporte= r-demo/keyingmaterialexporter.c b/sample/sample-plugins/keying-material-exp= orter-demo/keyingmaterialexporter.c
index cc256dd..f1f8868 = 100644
--- a/sample/sample-plugins/keying-material-exporter= -demo/keyingmaterialexporter.c
+++ b/sample/sample-plugins/= keying-material-exporter-demo/keyingmaterialexporter.c
@@ -= 69,9 +69,8 @@
{
if (envp)
<= span> {

- in= t i;
- const int= namelen =3D strlen(name);
- for (i =3D 0; envp[i]; ++i)
+ const size_t namelen =3D strlen(name);<= br>+ for (int i =3D 0; e= nvp[i]; ++i)
{
if (!s= trncmp(envp[i], name, namelen))
{
diff --git a/sample/sample-plugins/log/log.c b/sample/sample-plugins/lo= g/log.c

index 82595cf..b304f16 100644
--- a= /sample/sample-plugins/log/log.c
+++ b/sample/sample-plugin= s/log/log.c
@@ -52,9 +52,8 @@
{
= if (envp)
{
- int i;
- const int namelen =3D strlen(name);
- for (i =3D 0; envp[i]; ++i)
+ const size_t n= amelen =3D strlen(name);
+ for (int i =3D 0; envp[i]; ++i)
{
if (!strncmp(envp[i], name, namelen))
<= span> {

diff --git a/sample/sample-plugins/log/= log_v3.c b/sample/sample-plugins/log/log_v3.c
index c90cc3d= ..a024027 100644
--- a/sample/sample-plugins/log/log_v3.c
+++ b/sample/sample-plugins/log/log_v3.c
@@ = -55,9 +55,8 @@
{
if (envp)
= {
- i= nt i;
- const in= t namelen =3D strlen(name);
- for (i =3D 0; envp[i]; ++i)
+ const size_t namelen =3D strlen(name);=
+ for (int i =3D 0; = envp[i]; ++i)
{
if (!= strncmp(envp[i], name, namelen))
{
<= span>diff --git a/sample/sample-plugins/simple/base64.c b/sample/sample-plu= gins/simple/base64.c

index 6855966..e1cc791 100644--- a/sample/sample-plugins/simple/base64.c
+++ b/s= ample/sample-plugins/simple/base64.c
@@ -59,9 +59,8 @@
{
if (envp)
{=
- int i;
- const int namelen =3D strle= n(name);

- for (= i =3D 0; envp[i]; ++i)
+ for (int i =3D 0; envp[i]; ++i)
{
if (!strncmp(envp[i], na= me, namelen))
{
@@ -175,7 +174= ,7 @@

/* test the BASE64 encode func= tion */
char *buf =3D NULL;
- int r =3D ovpn_base64_encode(clcert_cn, strl= en(clcert_cn), &buf);
+ int r =3D ovpn_base64_encode(clcert_cn, (int)strlen(clcert_cn), &= amp;buf);
ovpn_log(PLOG_NOTE, PLUGIN_NAME, "BASE6= 4 encoded '%s' (return value %i): '%s'",
clcert_cn, r, buf);


dif= f --git a/sample/sample-plugins/simple/simple.c b/sample/sample-plugins/sim= ple/simple.c
index e17f3fa..2c096e2 100644
= --- a/sample/sample-plugins/simple/simple.c
+++ b/sample/sa= mple-plugins/simple/simple.c
@@ -54,9 +54,8 @@
{

if (envp)
{
- int i;
- const int namelen =3D strlen(name);=
- for (i =3D 0;= envp[i]; ++i)
+ = const size_t namelen =3D strlen(name);
+ for (int i =3D 0; envp[i]; ++i)
{
if (!strncmp(envp[i], name, name= len))
{
diff --git a/src/plugi= ns/auth-pam/auth-pam.c b/src/plugins/auth-pam/auth-pam.c
in= dex 8692806..7264f95 100644
--- a/src/plugins/auth-pam/auth= -pam.c
+++ b/src/plugins/auth-pam/auth-pam.c
@@ -165,31 +165,30 @@
}
}
-static int
-recv_string(int fd, char= *buffer, int len)
+s= tatic ssize_t
+recv_s= tring(int fd, char *buffer, size_t len)
{
= if (len > 0)
{
- ssize_t size;
memset= (buffer, 0, len);
- = size =3D read(fd, buffer, len);
+ ssize_t size =3D read(fd, buffer, len);
<= span> buffer[len-1] =3D 0;

if (size >= =3D 1)
{
- return (int)size;
+ return size;
}
}
return -1;
}

-static= int
+static ssize_t<= /span>
send_string(int fd, const char *string)
{=
- const int len =3D= strlen(string) + 1;
= + const size_t len =3D strlen(string) + 1;
const ss= ize_t size =3D write(fd, string, len);
if (size =3D=3D= len)
{
- return (int) size;
+ return size;
}
= else
{
@@ -645,27 +644,26 @@
* PAM conversation function
*/
static int

-my_conv= (int n, const struct pam_message **msg_array,
+my_conv(int num_msg, const struct pam_message **m= sg_array,
struct pam_response **response_array, vo= id *appdata_ptr)
{
const struct user_= pass *up =3D ( const struct user_pass *) appdata_ptr;
= struct pam_response *aresp;
- int i;
int ret =3D PAM_SUCCESS;

*response_array =3D NULL;

- if (n <=3D 0 || n &= gt; PAM_MAX_NUM_MSG)
= + if (num_msg <=3D 0 || num_msg > PAM_MAX_NUM_MSG)
{
return (PAM_CONV_ERR);
= }
- if ((aresp =3D= calloc(n, sizeof *aresp)) =3D=3D NULL)
+ if ((aresp =3D calloc((size_t)num_msg, sizeof *ares= p)) =3D=3D NULL)
{
return (PA= M_BUF_ERR);
}

/= * loop through each PAM-module query */
- for (i =3D 0; i < n; ++i)
+ for (int i =3D 0; i < num_msg; ++i)
{
const struct pam_message *ms= g =3D msg_array[i];
aresp[i].resp_retcode =3D 0;
@@ -683,9 +681,9 @@
{
/* use name/value list match method */

= const struct name_value_list *list =3D up->name_value_list;

- int j;=

/* loop through name/value pairs *= /
+ int j;= /* checked after loop */
for (j =3D 0; j <= list->len; ++j)
{
= const char *match_name =3D list->data[j].name;
= diff --git a/src/plugins/auth-pam/utils.c b/src/plugins/auth-pam/utils.c
index a6ccfbf..ab5e17e 100644
--- a/src/plugi= ns/auth-pam/utils.c
+++ b/src/plugins/auth-pam/utils.c

@@ -79,7 +79,7 @@

while = (scratch)
{
- strncat(temp, searching, scratch-searching);
<= span style=3D"color: hsl(120, 100%, 40%);">+ strncat(temp, searching= , (size_t)(scratch-searching));
strcat(temp, repla= cewith);

searching =3D scratch+s= trlen(searchfor);
@@ -93,9 +93,8 @@
{
if (envp)
{
- int i;
- const int namelen =3D strlen(name);
= - for (i =3D 0; envp[i]; += +i)
+ const si= ze_t namelen =3D strlen(name);
+ for (int i =3D 0; envp[i]; ++i)
= {
if (!strncmp(envp[i], name, namelen))
{
diff --git a/src/plugins/down-roo= t/down-root.c b/src/plugins/down-root/down-root.c
index 253= adcd..2c0faf4 100644
--- a/src/plugins/down-root/down-root.= c
+++ b/src/plugins/down-root/down-root.c
@= @ -88,9 +88,8 @@
{
if (envp) {
- = int i;
- const = int namelen =3D strlen(name);
- for (i =3D 0; envp[i]; ++i)
+ const size_t namelen =3D strlen(name);
+ for (int i =3D 0= ; envp[i]; ++i)
{
if = (!strncmp(envp[i], name, namelen))
{@@ -108,10 +107,10 @@
/*
* Return= the length of a string array
*/
-static int
+static size_t
string_array_len(const c= har *array[])
{
- int i =3D 0;
+ size_t i =3D 0;
if (array)
{

while (array[i])
@@ -141,1= 4 +140,14 @@
}
}

-static int
+static ssize_t

s= end_control(int fd, int code)
{
unsig= ned char c =3D (unsigned char) code;
const ssize_t siz= e =3D write(fd, &c, sizeof(c));
if (size =3D=3D si= zeof(c))
{
- return (int) size;
+ return size;
}
else

{
@@ -281,7 +280,6 @@
openvpn_plugin_open_v1(unsigned int *type_mask, const char *ar= gv[], const char *envp[])
{
struct do= wn_root_context *context;
- int i =3D 0;

/*
* Allocate our context

@@ -320,7 +318,7 @@=
}

/* Ignore argv[0], = as it contains just the plug-in file name */
- for (i =3D 1; i < string_array_len(argv); i++= )
+ for (int i =3D= 1; i < string_array_len(argv); i++)
{
context->command[i-1] =3D (char *) argv[i];

}

To view, visit change 1111. To unsu= bscribe, or for help writing mail filters, visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Id61df43bd79fc794a55e107daa0= 218c8441c2b2c
Gerrit-Change-Number: 1111
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
Gerrit-MessageType: newchange
--UCRv1PdwR64=--