You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by wr...@apache.org on 2005/05/16 23:45:53 UTC
svn commit: r170462 - /apr/apr/trunk/network_io/unix/inet_pton.c
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