From d93524b3930b276b4331511e98da902fe601e9f5 Mon Sep 17 00:00:00 2001 From: mtheall Date: Sun, 14 Dec 2014 14:56:20 -0600 Subject: [PATCH] Fix inet_aton. --- libctru/source/services/soc/soc_inet_aton.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/libctru/source/services/soc/soc_inet_aton.c b/libctru/source/services/soc/soc_inet_aton.c index 6e1f206..57f2bd4 100644 --- a/libctru/source/services/soc/soc_inet_aton.c +++ b/libctru/source/services/soc/soc_inet_aton.c @@ -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;