summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/main.c b/main.c
index e38ec0a..4359e78 100644
--- a/main.c
+++ b/main.c
@@ -107,7 +107,8 @@ void bridge_forward (const char * from, const char * msg, struct ircxmpp * ircxm
irc_cmd_msg(bridge->irc, ircxmpp->channel, msg);
irc_run_once(bridge);
} else if (msg) {
- bridge->messages = realloc(bridge->messages, bridge->messages_length+1);
+ bridge->messages = realloc(bridge->messages,
+ sizeof(*bridge->messages) * (bridge->messages_length+1));
bridge->messages[bridge->messages_length++] = strdup(msg);
}
} /* msg can be NULL, in that case we only join. */
@@ -237,7 +238,7 @@ void dump_event (irc_session_t * s, const char * e, const char * o, const char *
for (unsigned int i = 0; i < c; i++) {
if (i)
fprintf(stderr, "|");
- fprintf(stderr, p[i]);
+ fprintf(stderr, "%s", p[i]);
}
fprintf(stderr, "]\n");
}
@@ -595,6 +596,9 @@ cont:
xmpp_conn_release(ircxmpp.conn);
xmpp_ctx_free(ircxmpp.ctx);
xmpp_shutdown();
+ irc_cmd_quit(ircxmpp.irc, "vsesplošni izklop programa");
+ irc_run_once_control(&ircxmpp); // verjetno je to potrebno, da pošlje quit
+ irc_destroy_session(ircxmpp.irc);
free(ircxmpp.ircnick);
free(ircxmpp.irchost);
return 0;