summaryrefslogtreecommitdiff
path: root/sys/compat/svr4/svr4_misc.c
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/svr4/svr4_misc.c
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/svr4/svr4_misc.c')
-rw-r--r--sys/compat/svr4/svr4_misc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/compat/svr4/svr4_misc.c b/sys/compat/svr4/svr4_misc.c
index 6fce7a7d203..f02c0a925b7 100644
--- a/sys/compat/svr4/svr4_misc.c
+++ b/sys/compat/svr4/svr4_misc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: svr4_misc.c,v 1.43 2003/08/15 20:32:16 tedu Exp $ */
+/* $OpenBSD: svr4_misc.c,v 1.44 2004/06/22 23:52:18 jfb Exp $ */
/* $NetBSD: svr4_misc.c,v 1.42 1996/12/06 03:22:34 christos Exp $ */
/*
@@ -244,7 +244,7 @@ svr4_readdir_callback(arg, bdp, cookie)
idb.d_ino = (svr4_ino_t)bdp->d_fileno;
idb.d_off = (svr4_off_t)cookie;
idb.d_reclen = (u_short)svr4_reclen;
- strlcpy(idb.d_name, bdp->d_name, SVR4_MAXNAMLEN+1);
+ strlcpy(idb.d_name, bdp->d_name, sizeof(idb.d_name));
if ((error = copyout((caddr_t)&idb, cb->outp, svr4_reclen)))
return (error);
@@ -277,7 +277,7 @@ svr4_readdir64_callback(arg, bdp, cookie)
idb.d_ino = (svr4_ino64_t)bdp->d_fileno;
idb.d_off = (svr4_off64_t)cookie;
idb.d_reclen = (u_short)svr4_reclen;
- strlcpy(idb.d_name, bdp->d_name, SVR4_MAXNAMLEN+1);
+ strlcpy(idb.d_name, bdp->d_name, sizeof(idb.d_name));
if ((error = copyout((caddr_t)&idb, cb->outp, svr4_reclen)))
return (error);