[Openvpn-devel,v2,1/2] push.c: fix Visual Studio build

Message ID 1570539154-31784-1-git-send-email-lstipakov@gmail.com
State Accepted
Headers show
Series [Openvpn-devel,v2,1/2] push.c: fix Visual Studio build | expand

Commit Message

Lev Stipakov Oct. 8, 2019, 1:52 a.m. UTC
From: Lev Stipakov <lev@openvpn.net>

Visual Studio doesn't support empty designated initializers
for C code, so use { 0 }. Also replace existing CLEAR() call with
the new initializers.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
---
 src/openvpn/push.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

Gert Doering Oct. 8, 2019, 11:55 p.m. UTC | #1
Acked-by: Gert Doering <gert@greenie.muc.de>

Arne has already ACKed the first one, but this is more in line with
what we've done in "more recent code" - and also thanks for changing
the other occurrence.

"Stared at code" and lightly tested on Linux and FreeBSD.

Your patch has been applied to the master branch.

commit 4431d0903d4e23ef01a5582960990b77e9522ab2
Author: Lev Stipakov
Date:   Tue Oct 8 15:52:33 2019 +0300

     push.c: fix Visual Studio build

     Signed-off-by: Lev Stipakov <lev@openvpn.net>
     Acked-by: Gert Doering <gert@greenie.muc.de>
     Message-Id: <1570539154-31784-1-git-send-email-lstipakov@gmail.com>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg18904.html
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering

Patch

diff --git a/src/openvpn/push.c b/src/openvpn/push.c
index 49b9d1b..368b692 100644
--- a/src/openvpn/push.c
+++ b/src/openvpn/push.c
@@ -504,9 +504,8 @@  void
 send_push_reply_auth_token(struct tls_multi *multi)
 {
     struct gc_arena gc = gc_new();
+    struct push_list push_list = { 0 };
 
-
-    struct push_list push_list = {};
     prepare_auth_token_push_reply(multi, &gc, &push_list);
 
     /* prepare auth token should always add the auth-token option */
@@ -734,10 +733,9 @@  process_incoming_push_request(struct context *c)
         else
         {
             /* per-client push options - peer-id, cipher, ifconfig, ipv6-ifconfig */
-            struct push_list push_list;
+            struct push_list push_list = { 0 };
             struct gc_arena gc = gc_new();
 
-            CLEAR(push_list);
             if (prepare_push_reply(c, &gc, &push_list)
                 && send_push_reply(c, &push_list))
             {