From e91f42d0a6919b9848c0860593cdbcfddd950981 Mon Sep 17 00:00:00 2001 From: nishi Date: Thu, 18 Jan 2024 10:38:13 +0000 Subject: [PATCH] fixed windows warning git-svn-id: file:///raid/svn-main/nishi-libw3/trunk@26 d27a3e52-49c5-7645-884c-6793ebffc270 --- Example/fetch.c | 5 +++++ Library/DNS.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Example/fetch.c b/Example/fetch.c index b8b7dd7..5a99174 100644 --- a/Example/fetch.c +++ b/Example/fetch.c @@ -8,8 +8,13 @@ #include #include +#include int main(int argc, char** argv){ + if(argv[1] != NULL && strcmp(argv[1], "--version") == 0){ + printf("LibW3 %s\n", LIBW3_VERSION); + return 0; + } if(argc < 3){ fprintf(stderr, "Usage: %s URL Path\n", argv[0]); return 1; diff --git a/Library/DNS.c b/Library/DNS.c index d74135e..a612569 100644 --- a/Library/DNS.c +++ b/Library/DNS.c @@ -59,7 +59,7 @@ int __W3_DNS_Connect(const char* hostname, bool ssl, uint16_t port sock = socket(rp->ai_family, rp->ai_socktype, rp->ai_protocol); if(sock == -1) continue; int nzero = 0; - setsockopt(sock, SOL_SOCKET, SO_SNDBUF, &nzero, sizeof(nzero)); + setsockopt(sock, SOL_SOCKET, SO_SNDBUF, (char*)&nzero, sizeof(nzero)); if(connect(sock, rp->ai_addr, rp->ai_addrlen) != -1) break; close(sock); } -- 2.43.0