From 638496507882f0afe506fe294f68ad5290ef95db Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sat, 19 Nov 2011 10:07:32 -0800 Subject: Move variable declarations to get rid of unnecessary scope brackets Gets rid of one of the multiple levels of bracketing that confusingly shared the same indent level. Signed-off-by: Alan Coopersmith Reviewed-by: James Cloos --- src/sm_genid.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/sm_genid.c b/src/sm_genid.c index 700bbf2..2d87527 100644 --- a/src/sm_genid.c +++ b/src/sm_genid.c @@ -151,11 +151,6 @@ SmsGenerateClientID(SmsConn smsConn) char temp[256]; char *id; static int sequence = 0; - - if (gethostname (hostname, sizeof (hostname))) - return (NULL); - - { char* inet_addr; char *ptr1; unsigned char decimal[4]; @@ -163,6 +158,12 @@ SmsGenerateClientID(SmsConn smsConn) struct in_addr *haddr = NULL; # if defined(IPv6) && defined(AF_INET6) struct addrinfo *ai, *first_ai; +# endif + + if (gethostname (hostname, sizeof (hostname))) + return (NULL); + +# if defined(IPv6) && defined(AF_INET6) if (getaddrinfo(hostname,NULL,NULL,&ai) != 0) return NULL; @@ -235,7 +236,6 @@ SmsGenerateClientID(SmsConn smsConn) } freeaddrinfo(first_ai); # endif - } sprintf (temp, "1%s%.13ld%.10ld%.4d", address, (long)time((Time_t*)0), (long)getpid(), sequence); -- cgit v1.2.3