From 2d4c2ff351f0a295d2827c28ca747e3465422094 Mon Sep 17 00:00:00 2001 From: Ray Date: Mon, 22 Apr 2019 20:54:50 +0200 Subject: Review rnet errors --- src/rnet.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/rnet.c') diff --git a/src/rnet.c b/src/rnet.c index 07bc5ecc..79a6f07f 100644 --- a/src/rnet.c +++ b/src/rnet.c @@ -42,10 +42,10 @@ #include "raylib.h" -#include // Required for: assert() -#include // Required for: FILE, fopen(), fclose(), fread() -#include // Required for: malloc(), free() -#include // Required for: strcmp(), strncmp() +#include // Required for: assert() +#include // Required for: FILE, fopen(), fclose(), fread() +#include // Required for: malloc(), free() +#include // Required for: strcmp(), strncmp() //---------------------------------------------------------------------------------- // Module defines @@ -272,7 +272,7 @@ static char *SocketErrorCodeToString(int err) { #if defined(_WIN32) static char gaiStrErrorBuffer[GAI_STRERROR_BUFFER_SIZE]; - sprintf(gaiStrErrorBuffer, "%ws", gai_strerror(err)); + sprintf(gaiStrErrorBuffer, "%s", gai_strerror(err)); return gaiStrErrorBuffer; #else return gai_strerror(err); @@ -386,7 +386,7 @@ static bool CreateSocket(SocketConfig *config, SocketResult *outresult) char hoststr[NI_MAXHOST]; char portstr[NI_MAXSERV]; socklen_t client_len = sizeof(struct sockaddr_storage); - int rc = getnameinfo((struct sockaddr *) res->ai_addr, client_len, hoststr, sizeof(hoststr), portstr, sizeof(portstr), NI_NUMERICHOST | NI_NUMERICSERV); + int rc = getnameinfo((struct sockaddr *) res->ai_addr, client_len, hoststr, sizeof(hoststr), portstr, sizeof(portstr), NI_NUMERICHOST | NI_NUMERICSERV); TraceLog(LOG_INFO, "Successfully resolved host %s:%s", hoststr, portstr); } @@ -746,10 +746,10 @@ int ResolveHost(const char *address, const char *service, int addressType, int f hints.ai_family = addressType; // Either IPv4 or IPv6 (ADDRESS_TYPE_IPV4, ADDRESS_TYPE_IPV6) hints.ai_protocol = 0; // Automatically select correct protocol (IPPROTO_TCP), (IPPROTO_UDP) hints.ai_flags = flags; - assert(hints.ai_addrlen == NULL || hints.ai_addrlen == 0); - assert(hints.ai_canonname == NULL || hints.ai_canonname == 0); - assert(hints.ai_addr == NULL || hints.ai_addr == 0); - assert(hints.ai_next == NULL || hints.ai_next == 0); + assert((hints.ai_addrlen == NULL) || (hints.ai_addrlen == 0)); + assert((hints.ai_canonname == NULL) || (hints.ai_canonname == 0)); + assert((hints.ai_addr == NULL) || (hints.ai_addr == 0)); + assert((hints.ai_next == NULL) || (hints.ai_next == 0)); // When the address is NULL, populate the IP for me if (address == NULL) -- cgit v1.2.3