diff libpurple/protocols/oscar/clientlogin.c @ 31396:6f9a43a2b716

I noticed a NULL printf crash from the first chunk of this change. In the second chunk I changed the code to match the error message from the first chunk. I prefer this message.
author Mark Doliner <mark@kingant.net>
date Mon, 22 Nov 2010 09:54:54 +0000
parents f8f853ab3aba
children 7df08e88d9bb
line wrap: on
line diff
--- a/libpurple/protocols/oscar/clientlogin.c	Mon Nov 22 09:16:49 2010 +0000
+++ b/libpurple/protocols/oscar/clientlogin.c	Mon Nov 22 09:54:54 2010 +0000
@@ -335,7 +335,8 @@
 		/* Note to translators: The first %s is a URL, the second is an
 		   error message. */
 		tmp = g_strdup_printf(_("Error requesting %s: %s"),
-				get_start_oscar_session_url(od), error_message);
+				get_start_oscar_session_url(od), error_message ?
+				error_message : _("The server returned an empty response"));
 		purple_connection_error_reason(gc,
 				PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp);
 		g_free(tmp);
@@ -568,12 +569,9 @@
 
 	if (error_message != NULL || len == 0) {
 		gchar *tmp;
-		if (error_message != NULL)
-			tmp = g_strdup_printf(_("Error requesting %s: %s"),
-					get_client_login_url(od), error_message);
-		else
-			tmp = g_strdup_printf(_("Error requesting %s"),
-					get_client_login_url(od));
+		tmp = g_strdup_printf(_("Error requesting %s: %s"),
+				get_client_login_url(od), error_message ?
+				error_message : _("The server returned an empty response"));
 		purple_connection_error_reason(gc,
 				PURPLE_CONNECTION_ERROR_NETWORK_ERROR, tmp);
 		g_free(tmp);