diff libpurple/dnsquery.c @ 24916: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 002a58d4af7d
children 8290e36a5a73
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';
 	}