[PATCH:libSM 4/8] Reindent IPv4 code to match IPv6 code
Alan Coopersmith
alan.coopersmith at oracle.com
Mon Dec 5 20:06:17 PST 2011
Takes care of the other block of code confusingly sharing indent levels
Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
src/sm_genid.c | 54 +++++++++++++++++++++++++++---------------------------
1 files changed, 27 insertions(+), 27 deletions(-)
diff --git a/src/sm_genid.c b/src/sm_genid.c
index f0c196a..2ebebad 100644
--- a/src/sm_genid.c
+++ b/src/sm_genid.c
@@ -192,44 +192,44 @@ SmsGenerateClientID(SmsConn smsConn)
haddr = &((struct sockaddr_in *)ai->ai_addr)->sin_addr;
# else
# ifdef XTHREADS_NEEDS_BYNAMEPARAMS
- _Xgethostbynameparams hparams;
+ _Xgethostbynameparams hparams;
# endif
- struct hostent *hostp;
+ struct hostent *hostp;
- if ((hostp = _XGethostbyname (hostname,hparams)) != NULL)
- haddr = (struct in_addr *)(hostp->h_addr);
- else
- return NULL;
+ if ((hostp = _XGethostbyname (hostname,hparams)) != NULL)
+ haddr = (struct in_addr *)(hostp->h_addr);
+ else
+ return NULL;
# endif
- inet_addr = inet_ntoa (*haddr);
- for (i = 0, ptr1 = inet_addr; i < 3; i++)
- {
- char temp4[4];
- char *ptr2 = strchr (ptr1, '.');
- len = ptr2 - ptr1;
- if (!ptr2 || len > 3) {
+ inet_addr = inet_ntoa (*haddr);
+ for (i = 0, ptr1 = inet_addr; i < 3; i++)
+ {
+ char temp4[4];
+ char *ptr2 = strchr (ptr1, '.');
+ len = ptr2 - ptr1;
+ if (!ptr2 || len > 3) {
# if defined(IPv6) && defined(AF_INET6)
- freeaddrinfo(first_ai);
+ freeaddrinfo(first_ai);
# endif
- return (NULL);
+ return (NULL);
+ }
+ strncpy (temp4, ptr1, len);
+ temp4[len] = '\0';
+ decimal[i] = atoi (temp4);
+ ptr1 = ptr2 + 1;
}
- strncpy (temp4, ptr1, len);
- temp4[len] = '\0';
- decimal[i] = atoi (temp4);
- ptr1 = ptr2 + 1;
- }
- decimal[3] = atoi (ptr1);
+ decimal[3] = atoi (ptr1);
- *addr_ptr++ = '1';
+ *addr_ptr++ = '1';
- for (i = 0; i < 4; i++) {
- *addr_ptr++ = hex[decimal[i] >> 4];
- *addr_ptr++ = hex[decimal[i] & 0x0f];
- }
+ for (i = 0; i < 4; i++) {
+ *addr_ptr++ = hex[decimal[i] >> 4];
+ *addr_ptr++ = hex[decimal[i] & 0x0f];
+ }
- *addr_ptr++ = '\0';
+ *addr_ptr++ = '\0';
# if defined(IPv6) && defined(AF_INET6)
}
--
1.7.3.2
More information about the xorg-devel
mailing list