From 6259da3c1d7b143cf4b53e03c6955e35961877a3 Mon Sep 17 00:00:00 2001 From: gad Date: Wed, 23 Jun 2004 21:31:43 +0000 Subject: Replace a call to strncpy() with a call to strlcpy() Submitted by: Cyrille Lefevre --- lib/libkvm/kvm_proc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/libkvm/kvm_proc.c b/lib/libkvm/kvm_proc.c index 5abff82..87544ff 100644 --- a/lib/libkvm/kvm_proc.c +++ b/lib/libkvm/kvm_proc.c @@ -328,10 +328,8 @@ nopgrp: 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, -- cgit v1.1