changeset 27524:60d128c6413a

No functional change, but my gcc is bitching at me. Fixes this warning, don't ask me why. util.c: In function ¡Æpurple_fd_get_ip¡Ç: util.c:3114: warning: dereferencing pointer ¡Æaddr.605¡Ç does break strict-aliasing rules util.c:3114: note: initialized from here
author Stu Tomlinson <stu@nosnilmot.com>
date Fri, 10 Jul 2009 02:53:17 +0000
parents 9e916fd25f48
children 91b8a957776a
files libpurple/util.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/util.c	Fri Jul 10 02:47:09 2009 +0000
+++ b/libpurple/util.c	Fri Jul 10 02:53:17 2009 +0000
@@ -3099,13 +3099,15 @@
 {
 	struct sockaddr addr;
 	socklen_t namelen = sizeof(addr);
+	struct in_addr in;
 
 	g_return_val_if_fail(fd != 0, NULL);
 
 	if (getsockname(fd, &addr, &namelen))
 		return NULL;
 
-	return g_strdup(inet_ntoa(((struct sockaddr_in *)&addr)->sin_addr));
+	in = ((struct sockaddr_in *)&addr)->sin_addr;
+	return g_strdup(inet_ntoa(in));
 }