From 7acd93a6bef2dd9b660571c29b5f41c8ca351161 Mon Sep 17 00:00:00 2001 From: Frank Lichtenheld Date: Fri, 3 Feb 2023 20:14:40 +0100 Subject: [PATCH] Windows: fix signedness errors with recv/send 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 Acked-by: Gert Doering 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 --- src/openvpn/manage.c | 4 ++-- src/openvpn/proxy.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/openvpn/manage.c b/src/openvpn/manage.c index a55e5d788..db88e3479 100644 --- a/src/openvpn/manage.c +++ b/src/openvpn/manage.c @@ -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); diff --git a/src/openvpn/proxy.c b/src/openvpn/proxy.c index aa10363ce..ed47eaa20 100644 --- a/src/openvpn/proxy.c +++ b/src/openvpn/proxy.c @@ -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) -- 2.47.3