From 9e5b89965fc3d9ad3631bf8ef3335f14396f9e2f Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 19 Feb 2012 19:42:48 +0000 Subject: [PATCH] Fixed string handling on login message --- jabber.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/jabber.c b/jabber.c index 3b7c1dae..29badd1f 100644 --- a/jabber.c +++ b/jabber.c @@ -150,8 +150,10 @@ static void _jabber_conn_handler(xmpp_conn_t * const conn, xmpp_ctx_t *ctx = (xmpp_ctx_t *)userdata; if (status == XMPP_CONN_CONNECT) { - char line[100]; - sprintf(line, "%s logged in successfully.", xmpp_conn_get_jid(conn)); + const char *jid = xmpp_conn_get_jid(conn); + const char *msg = " logged in successfully."; + char line[strlen(jid) + strlen(msg) + 2]; + sprintf(line, "%s %s", xmpp_conn_get_jid(conn), msg); title_bar_connected(); cons_good_show(line);