changeset 31719:ccda2eba140b

Strip spaces when normalizing MSN usernames. Spaces in the account name magically worked, but caused weird problems such as broken don't-open-a-chat-on-MPOP logic. Fixes #13173.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Tue, 01 Mar 2011 05:09:26 +0000
parents a0b48278899e
children f60a5bec2a0d
files libpurple/protocols/msn/msn.c
diffstat 1 files changed, 3 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/msn.c	Tue Mar 01 04:41:59 2011 +0000
+++ b/libpurple/protocols/msn/msn.c	Tue Mar 01 05:09:26 2011 +0000
@@ -110,11 +110,9 @@
 
 	g_return_val_if_fail(str != NULL, NULL);
 
-	g_snprintf(buf, sizeof(buf), "%s%s", str,
-			   (strchr(str, '@') ? "" : "@hotmail.com"));
-
-	tmp = g_utf8_strdown(buf, -1);
-	strncpy(buf, tmp, sizeof(buf));
+	tmp = g_strchomp(g_utf8_strdown(str, -1));
+	g_snprintf(buf, sizeof(buf), "%s%s", tmp,
+			   (strchr(tmp, '@') ? "" : "@hotmail.com"));
 	g_free(tmp);
 
 	return buf;