Replace a call to strncpy() with a call to strlcpy()

Submitted by:	Cyrille Lefevre
This commit is contained in:
Garance A Drosehn 2004-06-23 21:31:43 +00:00
parent dd693acf27
commit b7e7c21adf

View File

@ -328,10 +328,8 @@ kvm_proclist(kd, what, arg, p, bp, maxcnt)
continue;
break;
}
if (proc.p_comm[0] != 0) {
strncpy(kp->ki_comm, proc.p_comm, MAXCOMLEN);
kp->ki_comm[MAXCOMLEN] = 0;
}
if (proc.p_comm[0] != 0)
strlcpy(kp->ki_comm, proc.p_comm, MAXCOMLEN);
(void)kvm_read(kd, (u_long)proc.p_sysent, (char *)&sysent,
sizeof(sysent));
(void)kvm_read(kd, (u_long)sysent.sv_name, (char *)&svname,