Usermode/libpsocket - Constify and bugfix
authorJohn Hodge (sonata) <[email protected]>
Tue, 11 Mar 2014 00:01:26 +0000 (08:01 +0800)
committerJohn Hodge (sonata) <[email protected]>
Tue, 11 Mar 2014 00:01:26 +0000 (08:01 +0800)
Usermode/Libraries/libpsocket.so_src/getaddrinfo.c
Usermode/Libraries/libpsocket.so_src/pton.c

index aa8128d..bd50f91 100644 (file)
@@ -113,9 +113,9 @@ int getaddrinfo(const char *node, const char *service, const struct addrinfo *hi
        // Convert `node` into types
        if( service )
        {
-               char *end;
+               const char *end;
                
-               default_port = strtol(service, &end, 0);
+               default_port = strtol(service, (char**)&end, 0);
                if( *end != '\0' && (hints->ai_flags & AI_NUMERICSERV) )
                {
                        return EAI_NONAME;
index 581c4f1..32cde27 100644 (file)
@@ -8,6 +8,7 @@
 #include <netinet/in.h>
 #include <net.h>       // Net_PrintAddress
 #include <acess/sys.h> // _SysDebug
+#include <string.h>
 
 // === CODE ===
 int inet_pton(int af, const char *src, void *dst)
@@ -22,10 +23,10 @@ const char *inet_ntop(int af, const void *src, char *dest, size_t len)
        switch(af)
        {
        case AF_INET:
-               str = Net_PrintAddress(4, ((struct in_addr*)src)->s_addr);
+               str = Net_PrintAddress(4, &((const struct in_addr*)src)->s_addr);
                break;
        case AF_INET6:
-               str = Net_PrintAddress(6, ((struct in6_addr*)src)->s6_addr);
+               str = Net_PrintAddress(6, &((const struct in6_addr*)src)->s6_addr);
                break;
        default:
                str = NULL;

UCC git Repository :: git.ucc.asn.au