From: nishi Date: Thu, 18 Jan 2024 10:38:13 +0000 (+0000) Subject: fixed windows warning X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=e91f42d0a6919b9848c0860593cdbcfddd950981;p=libw3.git fixed windows warning git-svn-id: file:///raid/svn-main/nishi-libw3/trunk@26 d27a3e52-49c5-7645-884c-6793ebffc270 --- 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); }