summaryrefslogtreecommitdiff
path: root/ares_parse_txt_reply.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2009-10-30 18:20:17 +0000
committerYang Tse <yangsita@gmail.com>2009-10-30 18:20:17 +0000
commit54a7da89c8036092cdce6f235c8e3c2fc56268ec (patch)
tree6a3b1eb48f0c312ba339d3d99da2bbe10c09ed94 /ares_parse_txt_reply.c
parente576d895e7b80e0adfba0e7c22ef361eca0f65a1 (diff)
downloadc-ares-54a7da89c8036092cdce6f235c8e3c2fc56268ec.tar.gz
c-ares-54a7da89c8036092cdce6f235c8e3c2fc56268ec.tar.bz2
c-ares-54a7da89c8036092cdce6f235c8e3c2fc56268ec.zip
Header inclusion depending on HAVE_* symbol.
Fix two typos.
Diffstat (limited to 'ares_parse_txt_reply.c')
-rw-r--r--ares_parse_txt_reply.c33
1 files changed, 23 insertions, 10 deletions
diff --git a/ares_parse_txt_reply.c b/ares_parse_txt_reply.c
index 6b0a787..6a83b07 100644
--- a/ares_parse_txt_reply.c
+++ b/ares_parse_txt_reply.c
@@ -19,21 +19,34 @@
#include "setup.h"
-#if defined(WIN32) && !defined(WATT32)
-#include "nameser.h"
+#ifdef HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
+#ifdef HAVE_NETDB_H
+# include <netdb.h>
+#endif
+#ifdef HAVE_ARPA_INET_H
+# include <arpa/inet.h>
+#endif
+#ifdef HAVE_ARPA_NAMESER_H
+# include <arpa/nameser.h>
#else
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#include <arpa/nameser.h>
+# include "nameser.h"
+#endif
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
-#include <arpa/nameser_compat.h>
+# include <arpa/nameser_compat.h>
#endif
+
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
#endif
#include <stdlib.h>
#include <string.h>
+
#include "ares.h"
#include "ares_dns.h"
#include "ares_private.h"
@@ -168,9 +181,9 @@ ares_parse_txt_reply (const unsigned char *abuf, int alen,
rr_name = NULL;
}
- if (hostname);
+ if (hostname)
free (hostname);
- if (rr_name);
+ if (rr_name)
free (rr_name);
/* clean up on error */