IRC_WHO_Channel(): Use strlcpy() instead of strcpy()

This fixes the following warning, at least on OpenBSD 4.8:

 irc-info.o(.text+0x2427): In function `IRC_WHO':
 src/ngircd/irc-info.c:896: warning: strcpy() is almost always misused,
                            please use strlcpy()
This commit is contained in:
Alexander Barton 2013-01-27 01:00:32 +01:00
parent d38d153f51
commit 8d8201502f
1 changed files with 2 additions and 1 deletions

View File

@ -893,7 +893,8 @@ IRC_WHO_Channel(CLIENT *Client, CHANNEL *Chan, bool OnlyOps)
is_visible = strchr(client_modes, 'i') == NULL;
if (is_member || is_visible) {
strcpy(flags, who_flags_status(client_modes));
strlcpy(flags, who_flags_status(client_modes),
sizeof(flags));
if (is_ircop)
strlcat(flags, "*", sizeof(flags));