diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2010-05-03 12:55:06 +0100 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2010-05-03 12:55:06 +0100 |
commit | 1a3ba05edfd8228908999d7c589f039513558539 (patch) | |
tree | cae67b73e0ac476360d944b187bcc4553d7dbada /irc_channel.c | |
parent | f92456381b2a1487036848fc4e0105b8a439facd (diff) |
Fixed strncpy() usage, and show error when trying to msg non-existent people
via the channel.
Diffstat (limited to 'irc_channel.c')
-rw-r--r-- | irc_channel.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/irc_channel.c b/irc_channel.c index fd79ba71..d318c397 100644 --- a/irc_channel.c +++ b/irc_channel.c @@ -200,6 +200,7 @@ static gboolean control_channel_privmsg( irc_channel_t *ic, const char *msg ) char to[s-msg+1]; irc_user_t *iu; + memset( to, 0, sizeof( to ) ); strncpy( to, msg, s - msg ); while( *(++s) && isspace( *s ) ) {} @@ -209,6 +210,11 @@ static gboolean control_channel_privmsg( irc_channel_t *ic, const char *msg ) iu->flags &= ~IRC_USER_PRIVATE; iu->f->privmsg( iu, s ); } + else + { + irc_send_msg_f( irc->root, "PRIVMSG", ic->name, + "User does not exist: %s", to ); + } } else { |