changeset 2076:6778b4b91221

[gaim-migrate @ 2086] faceprint's patch committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Tue, 17 Jul 2001 18:52:50 +0000
parents 75c06bcb022e
children 824dc84315c7
files plugins/icq/gaim_icq.c
diffstat 1 files changed, 16 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/icq/gaim_icq.c	Tue Jul 17 18:30:57 2001 +0000
+++ b/plugins/icq/gaim_icq.c	Tue Jul 17 18:52:50 2001 +0000
@@ -66,7 +66,7 @@
 }
 
 static void icq_sock_notify(int socket, int type, int status) {
-	struct gaim_sock *gs;
+	struct gaim_sock *gs = NULL;
 	if (status) {
 		GdkInputCondition cond;
 		if (type == ICQ_SOCKET_READ)
@@ -121,12 +121,27 @@
 	id->cur_status = STATUS_ONLINE;
 }
 
+void strip_linefeed(gchar *text)
+{
+	int i, j;
+	gchar *text2 = g_malloc(strlen(text) + 1);
+
+	for (i = 0, j = 0; text[i]; i++)
+		if (text[i] != '\r')
+			text2[j++] = text[i];
+	text2[j] = '\0';
+
+	strcpy(text, text2);
+	g_free(text2);
+}
+
 static void icq_msg_incoming(icq_Link *link, unsigned long uin, unsigned char hour, unsigned char minute,
 			unsigned char day, unsigned char month, unsigned short year, const char *data) {
 	struct gaim_connection *gc = find_gaim_conn_by_icq_link(link);
 	char buf[256], *tmp = g_malloc(BUF_LONG);
 	g_snprintf(tmp, BUF_LONG, "%s", data);
 	g_snprintf(buf, sizeof buf, "%lu", uin);
+	strip_linefeed(tmp);
 	serv_got_im(gc, buf, tmp, 0, time((time_t)NULL));
 	g_free(tmp);
 }