]> Pileus Git - ~andy/fetchmail/blobdiff - mxget.c
Avoid a warning message.
[~andy/fetchmail] / mxget.c
diff --git a/mxget.c b/mxget.c
index 3f266c01aa194cdb94cf8755d9d2d717a5787e56..91b2b418b1b23ff7ce94da9843544ba20df4d91f 100644 (file)
--- a/mxget.c
+++ b/mxget.c
@@ -1,13 +1,13 @@
 /*
  * mxget.c -- fetch MX records for given DNS name
  *
- * Copyright 1996 by Eric S. Raymond
- * All rights reserved.
+ * Copyright 1997 by Eric S. Raymond
  * For license terms, see the file COPYING in this directory.
  */
 
 #include "config.h"
 #ifdef HAVE_RES_SEARCH
+#include <stdio.h>
 #include <netdb.h>
 #include <sys/types.h>
 #include <netinet/in.h>
@@ -49,6 +49,8 @@ struct mxentry *getmxrecords(const char *name)
     static char MXHostBuf[PACKETSZ - HFIXEDSZ]; 
     HEADER *hp;
 
+    pmx->name = (char *)NULL;
+    pmx->pref = -1;
     n = res_search(name,C_IN,T_MX,(unsigned char*)&answer, sizeof(answer));
     if (n == -1)
        return((struct mxentry *)NULL);