Loading lib/if2ip.c +19 −8 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2008, 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 Loading Loading @@ -64,6 +64,13 @@ #include "inet_ntop.h" #include "strequal.h" #define _MPRINTF_REPLACE /* use our functions only */ #include <curl/mprintf.h> #include "memory.h" /* The last #include file should be: */ #include "memdebug.h" char *Curl_if2ip(int af, const char *interface, char *buf, int buf_size) { struct ifaddrs *iface, *head; Loading @@ -82,7 +89,8 @@ char *Curl_if2ip(int af, const char *interface, char *buf, int buf_size) scopeid = ((struct sockaddr_in6 *)iface->ifa_addr)->sin6_scope_id; if (scopeid) snprintf(scope, sizeof(scope), "%%%u", scopeid); } else } else addr = &((struct sockaddr_in *)iface->ifa_addr)->sin_addr; ip = (char *) Curl_inet_ntop(af, addr, buf, buf_size); strlcat(buf, scope, buf_size); Loading Loading @@ -130,8 +138,11 @@ char *Curl_if2ip(int af, const char *interface, char *buf, int buf_size) #endif #include "inet_ntop.h" #include "memory.h" #define _MPRINTF_REPLACE /* use our functions only */ #include <curl/mprintf.h> #include "memory.h" /* The last #include file should be: */ #include "memdebug.h" Loading Loading
lib/if2ip.c +19 −8 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al. * Copyright (C) 1998 - 2008, 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 Loading Loading @@ -64,6 +64,13 @@ #include "inet_ntop.h" #include "strequal.h" #define _MPRINTF_REPLACE /* use our functions only */ #include <curl/mprintf.h> #include "memory.h" /* The last #include file should be: */ #include "memdebug.h" char *Curl_if2ip(int af, const char *interface, char *buf, int buf_size) { struct ifaddrs *iface, *head; Loading @@ -82,7 +89,8 @@ char *Curl_if2ip(int af, const char *interface, char *buf, int buf_size) scopeid = ((struct sockaddr_in6 *)iface->ifa_addr)->sin6_scope_id; if (scopeid) snprintf(scope, sizeof(scope), "%%%u", scopeid); } else } else addr = &((struct sockaddr_in *)iface->ifa_addr)->sin_addr; ip = (char *) Curl_inet_ntop(af, addr, buf, buf_size); strlcat(buf, scope, buf_size); Loading Loading @@ -130,8 +138,11 @@ char *Curl_if2ip(int af, const char *interface, char *buf, int buf_size) #endif #include "inet_ntop.h" #include "memory.h" #define _MPRINTF_REPLACE /* use our functions only */ #include <curl/mprintf.h> #include "memory.h" /* The last #include file should be: */ #include "memdebug.h" Loading