diff --git a/src/Win32_Interop/Win32_FDAPI.cpp b/src/Win32_Interop/Win32_FDAPI.cpp index fc0ab5f7..1afcdd27 100644 --- a/src/Win32_Interop/Win32_FDAPI.cpp +++ b/src/Win32_Interop/Win32_FDAPI.cpp @@ -559,7 +559,7 @@ int redis_poll_impl(struct pollfd *fds, nfds_t nfds, int timeout) { nfds_t i; for (i = 0; i < nfds; i++) { - if (fds[i].fd < 0) { + if (fds[i].fd == INVALID_SOCKET) { continue; } if (pollCopy[i].fd >= FD_SETSIZE) { @@ -1218,7 +1218,7 @@ BOOL ParseStorageAddress(const char *ip, int port, SOCKADDR_STORAGE* pSotrageAdd /* Setting AI_PASSIVE will give you a wildcard address if addr is NULL */ hints.ai_flags = AI_NUMERICSERV | AI_PASSIVE; - if ((status = getaddrinfo(ip, port_buffer, &hints, &res) != 0)) { + if ((status = getaddrinfo(ip, port_buffer, &hints, &res)) != 0) { //fprintf(stderr, "getaddrinfo: %S\n", gai_strerror(status)); return FALSE; } diff --git a/src/Win32_Interop/win32fixes.c b/src/Win32_Interop/win32fixes.c index fbed1d2d..59b40f9c 100644 --- a/src/Win32_Interop/win32fixes.c +++ b/src/Win32_Interop/win32fixes.c @@ -86,7 +86,7 @@ int replace_random() { RtlGenRandom = (RtlGenRandomFunc)GetProcAddress(lib, "SystemFunction036"); if (RtlGenRandom == NULL) return 1; } - RtlGenRandom(&x, sizeof(UINT_MAX)); + RtlGenRandom(&x, sizeof(unsigned int)); return (int)(x >> 1); }