Module: ngircd.git Branch: master Commit: 8d8201502f79bfe6fdaf8e94a11544332bb9630a URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=8d820...
Author: Alexander Barton alex@barton.de Date: Sun Jan 27 01:00:32 2013 +0100
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()
---
src/ngircd/irc-info.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/ngircd/irc-info.c b/src/ngircd/irc-info.c index 57d6e1a..aaa607d 100644 --- a/src/ngircd/irc-info.c +++ b/src/ngircd/irc-info.c @@ -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));