]> Chaos Git - corbenik/ctrulib.git/commitdiff
Fix inet_aton.
authormtheall <pigman46@gmail.com>
Sun, 14 Dec 2014 20:56:20 +0000 (14:56 -0600)
committermtheall <pigman46@gmail.com>
Sun, 14 Dec 2014 20:56:20 +0000 (14:56 -0600)
libctru/source/services/soc/soc_inet_aton.c

index 6e1f20660d9587570c40b1c17ae69e078b011a59..57f2bd44ac7ea956204aada95d65d6f90353a72e 100644 (file)
@@ -54,23 +54,20 @@ int inet_aton(const char *cp, struct in_addr *inp)
 
        switch(num_bytes) {
        case 0:
-               return 0;
-
-       case 1:
                break;
 
-       case 2:
+       case 1:
                if(val > 0xFFFFFF) return 0;
                val |= bytes[0] << 24;
                break;
 
-       case 3:
+       case 2:
                if(val > 0xFFFF) return 0;
                val |= bytes[0] << 24;
                val |= bytes[1] << 16;
                break;
 
-       case 4:
+       case 3:
                if(val > 0xFF) return 0;
                val |= bytes[0] << 24;
                val |= bytes[1] << 16;