mirror of
https://github.com/moparisthebest/curl
synced 2024-12-22 08:08:50 -05:00
compiler warning fix
This commit is contained in:
parent
91386937ff
commit
d0aca8017f
@ -322,6 +322,9 @@ static char *lookup_service(unsigned short port, int flags,
|
|||||||
static void append_scopeid(struct sockaddr_in6 *addr6, unsigned int flags,
|
static void append_scopeid(struct sockaddr_in6 *addr6, unsigned int flags,
|
||||||
char *buf, size_t buflen)
|
char *buf, size_t buflen)
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_IF_INDEXTONAME
|
||||||
|
int is_ll, is_mcll;
|
||||||
|
#endif
|
||||||
char fmt_u[] = "%u";
|
char fmt_u[] = "%u";
|
||||||
char fmt_lu[] = "%lu";
|
char fmt_lu[] = "%lu";
|
||||||
char tmpbuf[IF_NAMESIZE + 2];
|
char tmpbuf[IF_NAMESIZE + 2];
|
||||||
@ -331,9 +334,10 @@ static void append_scopeid(struct sockaddr_in6 *addr6, unsigned int flags,
|
|||||||
tmpbuf[0] = '%';
|
tmpbuf[0] = '%';
|
||||||
|
|
||||||
#ifdef HAVE_IF_INDEXTONAME
|
#ifdef HAVE_IF_INDEXTONAME
|
||||||
|
is_ll = IN6_IS_ADDR_LINKLOCAL(&addr6->sin6_addr);
|
||||||
|
is_mcll = IN6_IS_ADDR_MC_LINKLOCAL(&addr6->sin6_addr);
|
||||||
if ((flags & ARES_NI_NUMERICSCOPE) ||
|
if ((flags & ARES_NI_NUMERICSCOPE) ||
|
||||||
(!IN6_IS_ADDR_LINKLOCAL(&addr6->sin6_addr)
|
(!is_ll && !is_mcll))
|
||||||
&& !IN6_IS_ADDR_MC_LINKLOCAL(&addr6->sin6_addr)))
|
|
||||||
{
|
{
|
||||||
sprintf(&tmpbuf[1], fmt, addr6->sin6_scope_id);
|
sprintf(&tmpbuf[1], fmt, addr6->sin6_scope_id);
|
||||||
}
|
}
|
||||||
|
@ -124,7 +124,7 @@ Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn,
|
|||||||
int port,
|
int port,
|
||||||
int *waitp)
|
int *waitp)
|
||||||
{
|
{
|
||||||
#if defined(HAVE_GETHOSTBYNAME_R_3) || defined(HAVE_GETHOSTBYNAME_R_6)
|
#if defined(HAVE_GETHOSTBYNAME_R_3)
|
||||||
int res;
|
int res;
|
||||||
#endif
|
#endif
|
||||||
Curl_addrinfo *ai = NULL;
|
Curl_addrinfo *ai = NULL;
|
||||||
@ -181,7 +181,7 @@ Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn,
|
|||||||
#ifdef HAVE_GETHOSTBYNAME_R_6
|
#ifdef HAVE_GETHOSTBYNAME_R_6
|
||||||
/* Linux */
|
/* Linux */
|
||||||
|
|
||||||
res=gethostbyname_r(hostname,
|
(void)gethostbyname_r(hostname,
|
||||||
(struct hostent *)buf,
|
(struct hostent *)buf,
|
||||||
(char *)buf + sizeof(struct hostent),
|
(char *)buf + sizeof(struct hostent),
|
||||||
CURL_HOSTENT_SIZE - sizeof(struct hostent),
|
CURL_HOSTENT_SIZE - sizeof(struct hostent),
|
||||||
|
Loading…
Reference in New Issue
Block a user