Allow sending empty messages in Session (just \r\n).
authorAndrej Kacian <ticho@claws-mail.org>
Sat, 12 Nov 2016 19:03:59 +0000 (20:03 +0100)
committerAndrej Kacian <ticho@claws-mail.org>
Sat, 12 Nov 2016 19:04:44 +0000 (20:04 +0100)
src/common/session.c

index 5e38f55..0e4a62d 100644 (file)
@@ -412,10 +412,9 @@ gint session_send_msg(Session *session, const gchar *msg)
 
        cm_return_val_if_fail(session->write_buf == NULL, -1);
        cm_return_val_if_fail(msg != NULL, -1);
-       cm_return_val_if_fail(msg[0] != '\0', -1);
 
        session->state = SESSION_SEND;
-       session->write_buf = g_strconcat(msg, "\r\n", NULL);
+       session->write_buf = g_strconcat((strlen(msg) > 0 ? msg : ""), "\r\n", NULL);
        session->write_buf_p = session->write_buf;
        session->write_buf_len = strlen(msg) + 2;