[telepathy-idle/master] Cope with Connection::quit-message being NULL.

Will Thompson will.thompson at collabora.co.uk
Wed May 27 16:08:05 PDT 2009


---
 src/idle-connection.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/idle-connection.c b/src/idle-connection.c
index 1e7929a..c874bdd 100644
--- a/src/idle-connection.c
+++ b/src/idle-connection.c
@@ -874,9 +874,10 @@ static void irc_handshakes(IdleConnection *conn) {
 
 static void send_quit_request(IdleConnection *conn) {
 	IdleConnectionPrivate *priv = IDLE_CONNECTION_GET_PRIVATE(conn);
-	gchar cmd[IRC_MSG_MAXLEN + 1];
+	gchar cmd[IRC_MSG_MAXLEN + 1] = "QUIT";
 
-	g_snprintf(cmd, IRC_MSG_MAXLEN + 1, "QUIT :%s", priv->quit_message);
+	if (priv->quit_message != NULL)
+		g_snprintf(cmd, IRC_MSG_MAXLEN + 1, "QUIT :%s", priv->quit_message);
 
 	_send_with_priority(conn, cmd, SERVER_CMD_MAX_PRIORITY);
 }
-- 
1.5.6.5




More information about the telepathy-commits mailing list