Unsafe use of strncpy replaced by strlcpy. CID 2257.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40628 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jonas Sundström 2011-02-23 00:37:01 +00:00
parent 7d5b23fb44
commit 117711e680

View File

@ -2271,7 +2271,7 @@ tn(int argc, char *argv[])
hostname = hostp;
memset(&su, 0, sizeof su);
su.sun_family = AF_UNIX;
strncpy(su.sun_path, hostp, sizeof su.sun_path);
strlcpy(su.sun_path, hostp, sizeof su.sun_path);
printf("Trying %s...\n", hostp);
net = socket(AF_UNIX, SOCK_STREAM, 0);
if ( net < 0) {