summaryrefslogtreecommitdiff
path: root/sys/compat/common
diff options
context:
space:
mode:
authorJean-Francois Brousseau <jfb@cvs.openbsd.org>2004-06-22 23:52:19 +0000
committerJean-Francois Brousseau <jfb@cvs.openbsd.org>2004-06-22 23:52:19 +0000
commit68fe655b77ab978f8d03f8feec46801220bd46c5 (patch)
treecf71e1513645d4dd977c3b1b4a92d6ec1578c8f6 /sys/compat/common
parent5557b30319fbfe74844a640472fa29a826d1be8b (diff)
Replace a whole bunch of scary uses of strncpy() with strlcpy() and
use compat-specific MAXNAMLEN values where appropriate ok millert@, pedro@
Diffstat (limited to 'sys/compat/common')
-rw-r--r--sys/compat/common/kern_info_09.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/compat/common/kern_info_09.c b/sys/compat/common/kern_info_09.c
index 38889b8757a..4686b9fba4d 100644
--- a/sys/compat/common/kern_info_09.c
+++ b/sys/compat/common/kern_info_09.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_info_09.c,v 1.11 2003/08/15 20:32:15 tedu Exp $ */
+/* $OpenBSD: kern_info_09.c,v 1.12 2004/06/22 23:52:17 jfb Exp $ */
/* $NetBSD: kern_info_09.c,v 1.5 1996/02/21 00:10:59 cgd Exp $ */
/*
@@ -113,9 +113,9 @@ compat_09_sys_uname(p, v, retval)
const char *cp;
char *dp, *ep;
- strncpy(outsname.sysname, ostype, sizeof(outsname.sysname));
- strncpy(outsname.nodename, hostname, sizeof(outsname.nodename));
- strncpy(outsname.release, osrelease, sizeof(outsname.release));
+ strlcpy(outsname.sysname, ostype, sizeof(outsname.sysname));
+ strlcpy(outsname.nodename, hostname, sizeof(outsname.nodename));
+ strlcpy(outsname.release, osrelease, sizeof(outsname.release));
dp = outsname.version;
ep = &outsname.version[sizeof(outsname.version) - 1];
for (cp = version; *cp && *cp != '('; cp++)
@@ -127,7 +127,7 @@ compat_09_sys_uname(p, v, retval)
for (; *cp && *cp != ':' && dp < ep; cp++)
*dp++ = *cp;
*dp = '\0';
- strncpy(outsname.machine, MACHINE, sizeof(outsname.machine));
+ strlcpy(outsname.machine, MACHINE, sizeof(outsname.machine));
return (copyout((caddr_t)&outsname, (caddr_t)SCARG(uap, name),
sizeof(struct outsname)));