diff libpurple/protocols/zephyr/zephyr.c @ 23203:313b87adb730

A patch from Peter O'Gorman at The Written Word, Inc. to fix various portability issues. These changes seemed reasonable, even though I wasn't able to test or verify them all in particular. Hopefully we don't break anything on another OS. Refs #3798 committer: Richard Laager <rlaager@wiktel.com>
author Peter O'Gorman <pogma@thewrittenword.com>
date Tue, 27 May 2008 01:11:46 +0000
parents 047c56435f1e
children 16734635febf 18550104ad58 ff29208e03ef
line wrap: on
line diff
--- a/libpurple/protocols/zephyr/zephyr.c	Mon May 26 17:10:55 2008 +0000
+++ b/libpurple/protocols/zephyr/zephyr.c	Tue May 27 01:11:46 2008 +0000
@@ -892,11 +892,16 @@
 			gconv1 = purple_find_conversation_with_account(PURPLE_CONV_TYPE_CHAT,
 														 zt2->name, gc->account);
 			gcc = purple_conversation_get_chat_data(gconv1);
-
+#ifndef INET_ADDRSTRLEN
+#define INET_ADDRSTRLEN 16
+#endif
 			if (!purple_conv_chat_find_user(gcc, sendertmp)) {
 				gchar ipaddr[INET_ADDRSTRLEN];
+#ifdef HAVE_INET_NTOP
 				inet_ntop(AF_INET, &notice.z_sender_addr.s_addr, ipaddr, sizeof(ipaddr));
-
+#else
+				memcpy(ipaddr,inet_ntoa(notice.z_sender_addr),sizeof(ipaddr));
+#endif
 				purple_conv_chat_add_user(gcc, sendertmp, ipaddr, PURPLE_CBFLAGS_NONE, TRUE);
 			}
 			g_free(sendertmp);