diff options
author | Přemysl Janouch <p.janouch@gmail.com> | 2014-09-21 02:22:02 +0200 |
---|---|---|
committer | Přemysl Janouch <p.janouch@gmail.com> | 2014-09-21 03:29:35 +0200 |
commit | 6c90cc85dba04a45cddbf2250e5e805a4b107b36 (patch) | |
tree | d8d1c1eba13a73e46937de87df08feb4675099e8 /plugins | |
parent | e7d8b244a9fb611c1b6233e20e9186de4541feba (diff) | |
download | ponymap-6c90cc85dba04a45cddbf2250e5e805a4b107b36.tar.gz ponymap-6c90cc85dba04a45cddbf2250e5e805a4b107b36.tar.xz ponymap-6c90cc85dba04a45cddbf2250e5e805a4b107b36.zip |
Fix the IRC plugin, and not only that
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/irc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/irc.c b/plugins/irc.c index 7732b73..c0e967d 100644 --- a/plugins/irc.c +++ b/plugins/irc.c @@ -217,8 +217,10 @@ static void * scan_init (struct unit *u) { char nick[IRC_MAX_NICKNAME + 1]; - for (size_t i = 0; i < sizeof nick - 1; i++) + size_t i; + for (i = 0; i < sizeof nick - 1; i++) nick[i] = 'a' + rand () % ('z' - 'a' + 1); + nick[i] = '\0'; struct str hello; str_init (&hello); @@ -267,7 +269,7 @@ on_irc_message (const struct irc_message *msg, const char *raw, void *user_data) if (code == IRC_RPL_MYINFO && msg->params.len > 0) { char *info = xstrdup_printf ("%s: %s", - "server name", msg->params.vector[0]); + "server name", msg->params.vector[1]); g_data.api->unit_add_info (scan->u, info); free (info); |