[Openvpn-devel,02/13] Mixing wide and regular strings in concatenations is not allowed in MSVC.

Message ID 20171010231130.6832-2-simon@rozman.si
State Accepted
Headers show
Series [Openvpn-devel,01/13] snwprintf() => _snwprintf() | expand

Commit Message

Simon Rozman Oct. 10, 2017, 12:11 p.m. UTC
From: Simon Rozman <simon@rozman.si>

---
 src/openvpnserv/interactive.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Selva Nair Oct. 11, 2017, 2:46 a.m. UTC | #1
Hi,

On Tue, Oct 10, 2017 at 7:11 PM, <simon@rozman.si> wrote:

> From: Simon Rozman <simon@rozman.si>
>
> ---
>  src/openvpnserv/interactive.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/src/openvpnserv/interactive.c b/src/openvpnserv/interactive.c
> index 9d473e4..4b08086 100644
> --- a/src/openvpnserv/interactive.c
> +++ b/src/openvpnserv/interactive.c
> @@ -370,12 +370,12 @@ ValidateOptions(HANDLE pipe, const WCHAR *workdir,
> const WCHAR *options)
>      BOOL ret = FALSE;
>      int i;
>      const WCHAR *msg1 = L"You have specified a config file location (%s
> relative to %s)"
> -                        " that requires admin approval. This error may be
> avoided"
> -                        " by adding your account to the \"%s\" group";
> +                        L" that requires admin approval. This error may
> be avoided"
> +                        L" by adding your account to the \"%s\" group";
>
>      const WCHAR *msg2 = L"You have specified an option (%s) that may be
> used"
> -                        " only with admin approval. This error may be
> avoided"
> -                        " by adding your account to the \"%s\" group";
> +                        L" only with admin approval. This error may be
> avoided"
> +                        L" by adding your account to the \"%s\" group";
>
>      argv = CommandLineToArgvW(options, &argc);
>

This one is easy, though the original is valid C99, MSVC does not support
concatenating non-identically prefixed strings.

ACK.
<div dir="ltr"><div class="gmail_extra">Hi,</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 10, 2017 at 7:11 PM,  <span dir="ltr">&lt;<a href="mailto:simon@rozman.si" target="_blank">simon@rozman.si</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Simon Rozman &lt;<a href="mailto:simon@rozman.si" target="_blank">simon@rozman.si</a>&gt;<br>
<br>
---<br>
 src/openvpnserv/interactive.c | 8 ++++----<br>
 1 file changed, 4 insertions(+), 4 deletions(-)<br>
<br>
diff --git a/src/openvpnserv/interactive.<wbr>c b/src/openvpnserv/interactive.<wbr>c<br>
index 9d473e4..4b08086 100644<br>
--- a/src/openvpnserv/interactive.<wbr>c<br>
+++ b/src/openvpnserv/interactive.<wbr>c<br>
@@ -370,12 +370,12 @@ ValidateOptions(HANDLE pipe, const WCHAR *workdir, const WCHAR *options)<br>
     BOOL ret = FALSE;<br>
     int i;<br>
     const WCHAR *msg1 = L&quot;You have specified a config file location (%s relative to %s)&quot;<br>
-                        &quot; that requires admin approval. This error may be avoided&quot;<br>
-                        &quot; by adding your account to the \&quot;%s\&quot; group&quot;;<br>
+                        L&quot; that requires admin approval. This error may be avoided&quot;<br>
+                        L&quot; by adding your account to the \&quot;%s\&quot; group&quot;;<br>
<br>
     const WCHAR *msg2 = L&quot;You have specified an option (%s) that may be used&quot;<br>
-                        &quot; only with admin approval. This error may be avoided&quot;<br>
-                        &quot; by adding your account to the \&quot;%s\&quot; group&quot;;<br>
+                        L&quot; only with admin approval. This error may be avoided&quot;<br>
+                        L&quot; by adding your account to the \&quot;%s\&quot; group&quot;;<br>
<br>
     argv = CommandLineToArgvW(options, &amp;argc);<br></blockquote><div><br></div><div>This one is easy, though the original is valid C99, MSVC does not support concatenating non-identically prefixed strings.</div><div><br></div><div>ACK.</div><div><br></div></div></div></div>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Gert Doering Oct. 11, 2017, 6:02 a.m. UTC | #2
Your patch has been applied to the master and release/2.4 branch.

commit d6e0917922793315b06aba395ed0666e17c5b44c (master)
commit 6e9da5a55673fe01ae7b780f0c438c81773109d5 (release/2.4)
Author: Simon Rozman
Date:   Wed Oct 11 01:11:19 2017 +0200

     Mixing wide and regular strings in concatenations is not allowed in MSVC.

     Acked-by: Selva Nair <selva.nair@gmail.com>
     Message-Id: <20171010231130.6832-2-simon@rozman.si>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg15579.html
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

Patch

diff --git a/src/openvpnserv/interactive.c b/src/openvpnserv/interactive.c
index 9d473e4..4b08086 100644
--- a/src/openvpnserv/interactive.c
+++ b/src/openvpnserv/interactive.c
@@ -370,12 +370,12 @@  ValidateOptions(HANDLE pipe, const WCHAR *workdir, const WCHAR *options)
     BOOL ret = FALSE;
     int i;
     const WCHAR *msg1 = L"You have specified a config file location (%s relative to %s)"
-                        " that requires admin approval. This error may be avoided"
-                        " by adding your account to the \"%s\" group";
+                        L" that requires admin approval. This error may be avoided"
+                        L" by adding your account to the \"%s\" group";
 
     const WCHAR *msg2 = L"You have specified an option (%s) that may be used"
-                        " only with admin approval. This error may be avoided"
-                        " by adding your account to the \"%s\" group";
+                        L" only with admin approval. This error may be avoided"
+                        L" by adding your account to the \"%s\" group";
 
     argv = CommandLineToArgvW(options, &argc);