]> Nishi Git Mirror - libw3.git/commitdiff
fixed windows warning
authornishi <nishi@d27a3e52-49c5-7645-884c-6793ebffc270>
Thu, 18 Jan 2024 10:38:13 +0000 (10:38 +0000)
committernishi <nishi@d27a3e52-49c5-7645-884c-6793ebffc270>
Thu, 18 Jan 2024 10:38:13 +0000 (10:38 +0000)
git-svn-id: file:///raid/svn-main/nishi-libw3/trunk@26 d27a3e52-49c5-7645-884c-6793ebffc270

Example/fetch.c
Library/DNS.c

index b8b7dd7370b3e24e959745b9edf2542a539a56de..5a991744ddf1e48c2a5c668a2459f2bc7863d043 100644 (file)
@@ -8,8 +8,13 @@
 
 #include <stdio.h>
 #include <stdbool.h>
+#include <string.h>
 
 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;
index d74135e996f68867e0d679bedb5e67dac7031e75..a612569eebf72244d1030beb21473b3c7c9ffda5 100644 (file)
@@ -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);
        }