changeset 27482:8accf7a2264c

The MSN client and server strips leading and trailing whitespace, so do the same locally before setting it, so that people don't think that their name actually included any. Also, there's no need to call strlen() to check that the length > 0. Fixes #9447 in a way.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Sun, 12 Jul 2009 05:06:45 +0000
parents 444542a43790
children 3dcc42d3cc12
files libpurple/protocols/msn/msn.c
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/msn.c	Sun Jul 12 04:41:10 2009 +0000
+++ b/libpurple/protocols/msn/msn.c	Sun Jul 12 05:06:45 2009 +0000
@@ -178,8 +178,12 @@
 	cmdproc = session->notification->cmdproc;
 	account = purple_connection_get_account(gc);
 
-	if(entry && strlen(entry))
-		alias = purple_url_encode(entry);
+	if (entry && *entry)
+	{
+		char *tmp = g_strdup(entry);
+		alias = purple_url_encode(g_strstrip(tmp));
+		g_free(tmp);
+	}
 	else
 		alias = "";
 
@@ -195,7 +199,6 @@
 	}
 
 	msn_cmdproc_send(cmdproc, "PRP", "MFN %s", alias);
-
 }
 
 static void