changeset 24885:1596d09393cf

Ludovico Cavedon noticed that on 64-bit platforms, when HAVE_GETADDRINFO isn't defined, there is a problem because we write out a size_t and read an int. Fixes #7733
author Daniel Atallah <daniel.atallah@gmail.com>
date Tue, 06 Jan 2009 04:11:09 +0000
parents 568b786c36f9
children 61f3a9f7a220
files libpurple/dnsquery.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/dnsquery.c	Tue Jan 06 02:28:10 2009 +0000
+++ b/libpurple/dnsquery.c	Tue Jan 06 04:11:09 2009 +0000
@@ -274,7 +274,6 @@
 			res = res->ai_next;
 		}
 		freeaddrinfo(tmp);
-		write_to_parent(child_out, &zero, sizeof(zero));
 #else
 		if (!inet_aton(dns_params.hostname, &sin.sin_addr)) {
 			struct hostent *hp;
@@ -292,11 +291,12 @@
 			sin.sin_family = AF_INET;
 
 		sin.sin_port = htons(dns_params.port);
-		write_to_parent(child_out, &zero, sizeof(zero));
+		rc = 0;
+		write_to_parent(child_out, &rc, sizeof(rc));
 		write_to_parent(child_out, &addrlen, sizeof(addrlen));
 		write_to_parent(child_out, &sin, addrlen);
+#endif
 		write_to_parent(child_out, &zero, sizeof(zero));
-#endif
 		dns_params.hostname[0] = '\0';
 	}