diff --git a/src/main.c b/src/main.c --- a/src/main.c +++ b/src/main.c @@ -94,10 +94,9 @@ while (!feof (message.stream)) { *buf = '\0'; + fgets (buf, 512, message.stream); - if (active) /* SIGPROC */ - fgets (buf, 512, message.stream); - else + if (!active) /* the bot was killed with SIGTERM */ break; if ((command = irc_parsemessage (buf, &message))) { @@ -117,7 +116,6 @@ /* * cleanup */ - if (uc.nick) free (uc.nick); if (uc.pass)