summaryrefslogtreecommitdiffstats
path: root/sys/kern/tty_info.c
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2009-02-28 14:20:26 +0000
committered <ed@FreeBSD.org>2009-02-28 14:20:26 +0000
commit51d425ac0e9404969edd449f9538d8d5b5d6541b (patch)
tree59f30355fa196ac09798c114dc5150840d387ece /sys/kern/tty_info.c
parentb342cbbd7afd2f2831b83817093c7f75c25d4b4d (diff)
downloadFreeBSD-src-51d425ac0e9404969edd449f9538d8d5b5d6541b.zip
FreeBSD-src-51d425ac0e9404969edd449f9538d8d5b5d6541b.tar.gz
Replace bcopy() calls inside the TTY layer with memcpy()/strlcpy().
In all these cases the buffers never overlap. Program names are also likely to be shorter, so use a regular strlcpy() to copy p_comm.
Diffstat (limited to 'sys/kern/tty_info.c')
-rw-r--r--sys/kern/tty_info.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/tty_info.c b/sys/kern/tty_info.c
index d5885b9..fc3a5cf 100644
--- a/sys/kern/tty_info.c
+++ b/sys/kern/tty_info.c
@@ -299,7 +299,7 @@ tty_info(struct tty *tp)
PGRP_UNLOCK(tp->t_pgrp);
rufetchcalc(pick, &ru, &utime, &stime);
pid = pick->p_pid;
- bcopy(pick->p_comm, comm, sizeof(comm));
+ strlcpy(comm, pick->p_comm, sizeof comm);
PROC_UNLOCK(pick);
/* Print command, pid, state, utime, stime, %cpu, and rss. */
OpenPOWER on IntegriCloud