apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r170462 - /apr/apr/trunk/network_io/unix/inet_pton.c
Date Mon, 16 May 2005 21:45:53 GMT
Author: wrowe
Date: Mon May 16 14:45:52 2005
New Revision: 170462

URL: http://svn.apache.org/viewcvs?rev=170462&view=rev
Log:

  Whitespace only - reindent to 4's

Modified:
    apr/apr/trunk/network_io/unix/inet_pton.c

Modified: apr/apr/trunk/network_io/unix/inet_pton.c
URL: http://svn.apache.org/viewcvs/apr/apr/trunk/network_io/unix/inet_pton.c?rev=170462&r1=170461&r2=170462&view=diff
==============================================================================
--- apr/apr/trunk/network_io/unix/inet_pton.c (original)
+++ apr/apr/trunk/network_io/unix/inet_pton.c Mon May 16 14:45:52 2005
@@ -105,40 +105,40 @@
 static int
 inet_pton4(const char *src, unsigned char *dst)
 {
-	static const char digits[] = "0123456789";
-	int saw_digit, octets, ch;
-	unsigned char tmp[INADDRSZ], *tp;
+    static const char digits[] = "0123456789";
+    int saw_digit, octets, ch;
+    unsigned char tmp[INADDRSZ], *tp;
 
-	saw_digit = 0;
-	octets = 0;
-	*(tp = tmp) = 0;
-	while ((ch = *src++) != '\0') {
-		const char *pch;
+    saw_digit = 0;
+    octets = 0;
+    *(tp = tmp) = 0;
+    while ((ch = *src++) != '\0') {
+	const char *pch;
 
-		if ((pch = strchr(digits, ch)) != NULL) {
-			unsigned int new = *tp * 10 + (pch - digits);
+	if ((pch = strchr(digits, ch)) != NULL) {
+	    unsigned int new = *tp * 10 + (pch - digits);
 
-			if (new > 255)
-				return (0);
-			*tp = new;
-			if (! saw_digit) {
-				if (++octets > 4)
-					return (0);
-				saw_digit = 1;
-			}
-		} else if (ch == '.' && saw_digit) {
-			if (octets == 4)
-				return (0);
-			*++tp = 0;
-			saw_digit = 0;
-		} else
-			return (0);
-	}
-	if (octets < 4)
+	    if (new > 255)
 		return (0);
+	    *tp = new;
+	    if (! saw_digit) {
+		if (++octets > 4)
+		    return (0);
+		saw_digit = 1;
+	    }
+	} else if (ch == '.' && saw_digit) {
+	    if (octets == 4)
+		return (0);
+	    *++tp = 0;
+	    saw_digit = 0;
+	} else
+		return (0);
+    }
+    if (octets < 4)
+	return (0);
 
-	memcpy(dst, tmp, INADDRSZ);
-	return (1);
+    memcpy(dst, tmp, INADDRSZ);
+    return (1);
 }
 
 #if APR_HAVE_IPV6



Mime
View raw message