small fix, don't write message to server if channel is not given

This commit is contained in:
Anselm R. Garbe 2007-02-08 15:03:42 +01:00
parent cb68ce9e2c
commit ea71b6e88e

2
sic.c
View File

@ -53,6 +53,8 @@ pout(char *channel, char *msg) {
static void static void
privmsg(char *channel, char *msg) { privmsg(char *channel, char *msg) {
if(channel[0] == 0)
return;
snprintf(bufout, sizeof bufout, "<%s> %s", nick, msg); snprintf(bufout, sizeof bufout, "<%s> %s", nick, msg);
pout(channel, bufout); pout(channel, bufout);
snprintf(bufout, sizeof bufout, "PRIVMSG %s :%s\r\n", channel, msg); snprintf(bufout, sizeof bufout, "PRIVMSG %s :%s\r\n", channel, msg);