Module: ngircd.git Branch: master Commit: 4123118d5a1a92e74fb82131b29f65d5067442dc URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=41231...
Author: Alexander Barton alex@barton.de Date: Sun Nov 11 11:18:53 2012 +0100
conf.c: Use strlcpy() instead of strcpy()
This fixes the following warning of gcc on OpenBSD 5.0: conf.c:728: warning: strcpy() is almost always misused, please use strlcpy()
---
src/ngircd/conf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/ngircd/conf.c b/src/ngircd/conf.c index da7ff84..bea4d61 100644 --- a/src/ngircd/conf.c +++ b/src/ngircd/conf.c @@ -725,7 +725,8 @@ Set_Defaults(bool InitServers) strlcpy(Conf_Chroot, CHROOT_DIR, sizeof(Conf_Chroot)); strcpy(Conf_CloakHost, ""); strcpy(Conf_CloakHostModeX, ""); - strcpy(Conf_CloakHostSalt, ngt_RandomStr(random, RANDOM_SALT_LEN)); + strlcpy(Conf_CloakHostSalt, ngt_RandomStr(random, RANDOM_SALT_LEN), + sizeof(Conf_CloakHostSalt)); Conf_CloakUserToNick = false; Conf_ConnectIPv4 = true; #ifdef WANT_IPV6
ngircd-commits@lists.barton.de