summaryrefslogtreecommitdiff
path: root/usr/src/lib/libresolv/res_gethost.c
diff options
context:
space:
mode:
authorGary Mills <gary_mills@fastmail.fm>2015-07-20 12:47:39 -0500
committerRobert Mustacchi <rm@joyent.com>2015-07-23 10:13:23 -0700
commitbd0e95e605fff368075e869efe6d31ebe471ea49 (patch)
treedb10a086883415ad2176002b49e17a132fea4545 /usr/src/lib/libresolv/res_gethost.c
parent3f745f41d6d087602fbb2f748e1baabc3768f5fb (diff)
downloadillumos-joyent-bd0e95e605fff368075e869efe6d31ebe471ea49.tar.gz
1926 libresolv evades compiler warnings
Reviewed by: Toomas Soome <tsoome@me.com> Reviewed by: Albert Lee <trisk@omniti.com> Approved by: Robert Mustacchi <rm@joyent.com>
Diffstat (limited to 'usr/src/lib/libresolv/res_gethost.c')
-rw-r--r--usr/src/lib/libresolv/res_gethost.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/usr/src/lib/libresolv/res_gethost.c b/usr/src/lib/libresolv/res_gethost.c
index bc25771d6d..9649677d2a 100644
--- a/usr/src/lib/libresolv/res_gethost.c
+++ b/usr/src/lib/libresolv/res_gethost.c
@@ -1,4 +1,5 @@
/*
+ * Copyright 2015 Gary Mills
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -23,10 +24,12 @@
#include <netdb.h>
#include <stdio.h>
#include <errno.h>
+#include <string.h>
#include <arpa/inet.h>
#include <arpa/nameser.h>
#include <resolv.h>
#include <syslog.h>
+#include "crossl.h"
/*
* When the name service switch calls libresolv, it doesn't want fallback
@@ -103,8 +106,8 @@ getanswer(answer, anslen, iquery)
cp = answer->buf + sizeof (HEADER);
if (qdcount) {
if (iquery) {
- if ((n = dn_expand((char *)answer->buf, eom,
- cp, bp, buflen)) < 0) {
+ if ((n = dn_expand(answer->buf, eom,
+ cp, (u_char *)bp, buflen)) < 0) {
h_errno = NO_RECOVERY;
return ((struct hostent *) NULL);
}
@@ -132,8 +135,8 @@ getanswer(answer, anslen, iquery)
#endif
haveanswer = 0;
while (--ancount >= 0 && cp < eom && haveanswer < MAXADDRS) {
- if ((n = dn_expand((char *)answer->buf, eom,
- cp, bp, buflen)) < 0)
+ if ((n = dn_expand(answer->buf, eom,
+ cp, (u_char *)bp, buflen)) < 0)
break;
cp += n;
type = _getshort(cp);
@@ -153,8 +156,8 @@ getanswer(answer, anslen, iquery)
continue;
}
if (iquery && type == T_PTR) {
- if ((n = dn_expand((char *)answer->buf, eom,
- cp, bp, buflen)) < 0) {
+ if ((n = dn_expand(answer->buf, eom,
+ cp, (u_char *)bp, buflen)) < 0) {
cp += n;
continue;
}
@@ -231,7 +234,6 @@ res_gethostbyname(name)
querybuf buf;
register char *cp;
int n;
- struct hostent *hp, *gethostdomain();
/*
* disallow names consisting only of digits/dots, unless
@@ -281,7 +283,7 @@ _getrhbyaddr(addr, len, type)
((unsigned)addr[2] & 0xff),
((unsigned)addr[1] & 0xff),
((unsigned)addr[0] & 0xff));
- n = res_query(qbuf, C_IN, T_PTR, (char *)&buf, sizeof (buf));
+ n = res_query(qbuf, C_IN, T_PTR, (u_char *)&buf, sizeof (buf));
if (n < 0) {
#ifdef DEBUG
if (_res.options & RES_DEBUG)