summaryrefslogtreecommitdiff
path: root/lib/if2ip.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2011-04-20 15:17:42 +0200
committerDaniel Stenberg <daniel@haxx.se>2011-04-27 09:09:35 +0200
commitb903186fa0189ff241d756d25d07fdfe9885ae49 (patch)
treebd942ac8753469172661b0d30153986378337fdf /lib/if2ip.c
parent592eda8e3feb1bf8d0f85c2baa485323b315f9d9 (diff)
downloadcurl-b903186fa0189ff241d756d25d07fdfe9885ae49.tar.gz
source cleanup: unify look, style and indent levels
By the use of a the new lib/checksrc.pl script that checks that our basic source style rules are followed.
Diffstat (limited to 'lib/if2ip.c')
-rw-r--r--lib/if2ip.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/if2ip.c b/lib/if2ip.c
index 19504d1fd..4924f7301 100644
--- a/lib/if2ip.c
+++ b/lib/if2ip.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -76,22 +76,22 @@ char *Curl_if2ip(int af, const char *interface, char *buf, int buf_size)
struct ifaddrs *iface, *head;
char *ip=NULL;
- if (getifaddrs(&head) >= 0) {
- for (iface=head; iface != NULL; iface=iface->ifa_next) {
- if ((iface->ifa_addr != NULL) &&
- (iface->ifa_addr->sa_family == af) &&
- curl_strequal(iface->ifa_name, interface)) {
+ if(getifaddrs(&head) >= 0) {
+ for(iface=head; iface != NULL; iface=iface->ifa_next) {
+ if((iface->ifa_addr != NULL) &&
+ (iface->ifa_addr->sa_family == af) &&
+ curl_strequal(iface->ifa_name, interface)) {
void *addr;
char scope[12]="";
#ifdef ENABLE_IPV6
- if (af == AF_INET6) {
+ if(af == AF_INET6) {
unsigned int scopeid = 0;
addr = &((struct sockaddr_in6 *)iface->ifa_addr)->sin6_addr;
#ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID
/* Include the scope of this interface as part of the address */
scopeid = ((struct sockaddr_in6 *)iface->ifa_addr)->sin6_scope_id;
#endif
- if (scopeid)
+ if(scopeid)
snprintf(scope, sizeof(scope), "%%%u", scopeid);
}
else