]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Windows: fix signedness errors with recv/send
authorFrank Lichtenheld <frank@lichtenheld.com>
Fri, 3 Feb 2023 19:14:40 +0000 (20:14 +0100)
committerGert Doering <gert@greenie.muc.de>
Sat, 25 Feb 2023 16:46:59 +0000 (17:46 +0100)
On Linux those functions actually take void pointer,
so no behavior change there. On Windows, we avoid
warnings about unsigned char vs char.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20230203191440.136050-6-frank@lichtenheld.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg26144.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/manage.c
src/openvpn/proxy.c

index a55e5d78823b5976ad70bc64e0f864b35e507743..db88e347911b0ca3bd29bf3b5e411142b5847433 100644 (file)
@@ -2255,7 +2255,7 @@ man_read(struct management *man)
         man->connection.lastfdreceived = fd;
     }
 #else  /* ifdef TARGET_ANDROID */
-    len = recv(man->connection.sd_cli, buf, sizeof(buf), MSG_NOSIGNAL);
+    len = recv(man->connection.sd_cli, (void *)buf, sizeof(buf), MSG_NOSIGNAL);
 #endif
 
     if (len == 0)
@@ -2352,7 +2352,7 @@ man_write(struct management *man)
         }
         else
 #endif
-        sent = send(man->connection.sd_cli, BPTR(buf), len, MSG_NOSIGNAL);
+        sent = send(man->connection.sd_cli, (const void *)BPTR(buf), len, MSG_NOSIGNAL);
         if (sent >= 0)
         {
             buffer_list_advance(man->connection.out, sent);
index aa10363ce7fc56ddb024d18d20aa3adf546e0533..ed47eaa20c5798f984c4678d5b8c5fb611b68d73 100644 (file)
@@ -126,7 +126,7 @@ recv_line(socket_descriptor_t sd,
         }
 
         /* read single char */
-        size = recv(sd, &c, 1, MSG_NOSIGNAL);
+        size = recv(sd, (void *)&c, 1, MSG_NOSIGNAL);
 
         /* error? */
         if (size != 1)