diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2011-11-19 10:13:02 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2011-12-09 17:37:06 -0800 |
commit | fb3ef5844d392f70cc6bd9b0d8770ca17bde1428 (patch) | |
tree | f023b2920ce0d49fa4a1ee0eee411af685c58702 /src/sm_genid.c | |
parent | 638496507882f0afe506fe294f68ad5290ef95db (diff) |
Reindent IPv4 code to match IPv6 code
Takes care of the other block of code confusingly sharing indent levels
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: James Cloos <cloos@jhcloos.com>
Diffstat (limited to 'src/sm_genid.c')
-rw-r--r-- | 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 2d87527..ffeab7e 100644 --- a/src/sm_genid.c +++ b/src/sm_genid.c @@ -192,45 +192,45 @@ 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, '.'); + 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) { + 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) } |