changeset 24610:9ffd54bf622a

fixes a printf crash on Windows, reported by InstantBird developer fqueze
author Ka-Hing Cheung <khc@hxbc.us>
date Sun, 07 Dec 2008 02:12:00 +0000
parents 4895879ebafb
children 39289fd7e67f 1f9700b825a4
files libpurple/protocols/qq/qq.c
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/qq/qq.c	Sat Dec 06 20:02:49 2008 +0000
+++ b/libpurple/protocols/qq/qq.c	Sun Dec 07 02:12:00 2008 +0000
@@ -100,10 +100,13 @@
 	qd->use_tcp = purple_account_get_bool(account, "use_tcp", TRUE);
 
 	custom_server = purple_account_get_string(account, "server", NULL);
-	purple_debug_info("QQ", "Select server '%s'\n", custom_server);
-	if ( (custom_server != NULL && strlen(custom_server) > 0) && strcasecmp(custom_server, "auto") != 0) {
-		qd->servers = g_list_append(qd->servers, g_strdup(custom_server));
-		return;
+
+	if (custom_server != NULL) {
+		purple_debug_info("QQ", "Select server '%s'\n", custom_server);
+		if (*custom_server != '\0' && g_ascii_strcasecmp(custom_server, "auto") != 0) {
+			qd->servers = g_list_append(qd->servers, g_strdup(custom_server));
+			return;
+		}
 	}
 
 	if (qd->use_tcp) {