Unsafe use of strncpy replaced by strlcpy. CID 2214.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40636 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jonas Sundström 2011-02-23 02:54:16 +00:00
parent 73da57481b
commit 6e9c6db2e9

View File

@ -36,11 +36,8 @@ static char iroha_server_name[CANNA_SERVER_NAME_LEN] = {0, 0};
int
RkSetServerName(char *s)
{
if (s)
(void)strncpy(iroha_server_name, s, CANNA_SERVER_NAME_LEN);
else
iroha_server_name[0] = '\0';
return 0;
strlcpy(iroha_server_name, s, CANNA_SERVER_NAME_LEN);
return 0;
}
char *