aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mx.h6
-rw-r--r--mxget.c7
2 files changed, 6 insertions, 7 deletions
diff --git a/mx.h b/mx.h
index b32a7ef4..0a28f2b0 100644
--- a/mx.h
+++ b/mx.h
@@ -2,11 +2,11 @@
struct mxentry
{
- unsigned char *name;
- int pref;
+ char *name;
+ int pref;
};
-extern struct mxentry * getmxrecords(const unsigned char *);
+extern struct mxentry * getmxrecords(const char *);
/* some versions of FreeBSD should declare this but don't */
extern int h_errno;
diff --git a/mxget.c b/mxget.c
index 726417b1..876b2c88 100644
--- a/mxget.c
+++ b/mxget.c
@@ -40,10 +40,10 @@
/* minimum possible size of MX record in packet */
#define MIN_MX_SIZE 8 /* corresp to "a.com 0" w/ terminating space */
-struct mxentry *getmxrecords(const unsigned char *name)
+struct mxentry *getmxrecords(const char *name)
/* get MX records for given host */
{
- unsigned char answer[PACKETSZ], *eom, *cp, *bp;
+ char answer[PACKETSZ], *eom, *cp, *bp;
int n, ancount, qdcount, buflen, type, pref, ind;
static struct mxentry pmx[(PACKETSZ - HFIXEDSZ) / MIN_MX_SIZE];
static char MXHostBuf[PACKETSZ - HFIXEDSZ];
@@ -51,8 +51,7 @@ struct mxentry *getmxrecords(const unsigned char *name)
pmx->name = (char *)NULL;
pmx->pref = -1;
- n = res_search((char *)name,
- C_IN,T_MX, (unsigned char*)&answer, sizeof(answer));
+ n = res_search(name, C_IN,T_MX, &answer, sizeof(answer));
if (n == -1)
return((struct mxentry *)NULL);