From 675238071fad7df825f65449f42752e44361faa4 Mon Sep 17 00:00:00 2001 From: mdf Date: Thu, 10 Mar 2011 22:56:00 +0000 Subject: Use MAXPATHLEN rather than the size of an extern array when copying the kernel name. Also consistenly use strlcpy(). Suggested by: Warner Losh --- sys/sun4v/sun4v/machdep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys/sun4v') 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); } -- cgit v1.1