summaryrefslogtreecommitdiffstats
path: root/sys/sun4v
diff options
context:
space:
mode:
authormdf <mdf@FreeBSD.org>2011-03-10 22:56:00 +0000
committermdf <mdf@FreeBSD.org>2011-03-10 22:56:00 +0000
commit675238071fad7df825f65449f42752e44361faa4 (patch)
tree0f629dcb8979d33586fead72ed3a7a78a82dc6f7 /sys/sun4v
parent4d0b0c3ea7c6b84879b05b6bc1451da875585865 (diff)
downloadFreeBSD-src-675238071fad7df825f65449f42752e44361faa4.zip
FreeBSD-src-675238071fad7df825f65449f42752e44361faa4.tar.gz
Use MAXPATHLEN rather than the size of an extern array when copying the
kernel name. Also consistenly use strlcpy(). Suggested by: Warner Losh
Diffstat (limited to 'sys/sun4v')
-rw-r--r--sys/sun4v/sun4v/machdep.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/sun4v/sun4v/machdep.c b/sys/sun4v/sun4v/machdep.c
index 9475933..8016667 100644
--- a/sys/sun4v/sun4v/machdep.c
+++ b/sys/sun4v/sun4v/machdep.c
@@ -425,7 +425,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_long o2, u_long o3, ofw_vec_t *vec)
env = getenv("kernelname");
if (env != NULL) {
- strlcpy(kernelname, env, sizeof(kernelname));
+ strlcpy(kernelname, env, MAXPATHLEN);
freeenv(env);
}
OpenPOWER on IntegriCloud