diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-05-07 22:16:27 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-05-07 22:16:27 +0000 |
commit | 14822662bdf25d6ee737555bce42c64f0222b331 (patch) | |
tree | eb3abec1e131fbf59e43955fb59eb46382ce2089 /sys | |
parent | a1ec18de9fe2333d0d92c76ab5d91e7e9c54e8ed (diff) |
string cleaning; ok art tedu
Diffstat (limited to 'sys')
-rw-r--r-- | sys/compat/svr4/svr4_stat.c | 38 | ||||
-rw-r--r-- | sys/msdosfs/msdosfs_vnops.c | 8 |
2 files changed, 24 insertions, 22 deletions
diff --git a/sys/compat/svr4/svr4_stat.c b/sys/compat/svr4/svr4_stat.c index f41133b1c2b..cad97e3dcdf 100644 --- a/sys/compat/svr4/svr4_stat.c +++ b/sys/compat/svr4/svr4_stat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: svr4_stat.c,v 1.23 2003/01/09 22:27:11 miod Exp $ */ +/* $OpenBSD: svr4_stat.c,v 1.24 2003/05/07 22:16:26 deraadt Exp $ */ /* $NetBSD: svr4_stat.c,v 1.21 1996/04/22 01:16:07 christos Exp $ */ /* @@ -123,7 +123,7 @@ bsd_to_svr4_xstat(st, st4) st4->st_ctim = st->st_ctimespec; st4->st_blksize = st->st_blksize; st4->st_blocks = st->st_blocks; - strcpy(st4->st_fstype, "unknown"); + strlcpy(st4->st_fstype, "unknown", sizeof st4->st_fstype); } static void @@ -132,20 +132,20 @@ bsd_to_svr4_stat64(st, st4) struct svr4_stat64 *st4; { bzero(st4, sizeof(*st4)); - st4->st_dev = bsd_to_svr4_dev_t(st->st_dev); - st4->st_ino = st->st_ino; - st4->st_mode = BSD_TO_SVR4_MODE(st->st_mode); - st4->st_nlink = st->st_nlink; - st4->st_uid = st->st_uid; - st4->st_gid = st->st_gid; - st4->st_rdev = bsd_to_svr4_dev_t(st->st_rdev); - st4->st_size = st->st_size; - st4->st_atim = st->st_atimespec; - st4->st_mtim = st->st_mtimespec; - st4->st_ctim = st->st_ctimespec; - st4->st_blksize = st->st_blksize; - st4->st_blocks = st->st_blocks; - strcpy(st4->st_fstype, "unknown"); + st4->st_dev = bsd_to_svr4_dev_t(st->st_dev); + st4->st_ino = st->st_ino; + st4->st_mode = BSD_TO_SVR4_MODE(st->st_mode); + st4->st_nlink = st->st_nlink; + st4->st_uid = st->st_uid; + st4->st_gid = st->st_gid; + st4->st_rdev = bsd_to_svr4_dev_t(st->st_rdev); + st4->st_size = st->st_size; + st4->st_atim = st->st_atimespec; + st4->st_mtim = st->st_mtimespec; + st4->st_ctim = st->st_ctimespec; + st4->st_blksize = st->st_blksize; + st4->st_blocks = st->st_blocks; + strlcpy(st4->st_fstype, "unknown", sizeof st4->st_fstype); } @@ -504,9 +504,9 @@ svr4_ustat(p, v, retval) bzero(&us, sizeof us); /* - * XXX: should set f_tfree and f_tinode at least - * How do we translate dev -> fstat? (and then to svr4_ustat) - */ + * XXX: should set f_tfree and f_tinode at least + * How do we translate dev -> fstat? (and then to svr4_ustat) + */ if ((error = copyout(&us, SCARG(uap, name), sizeof us)) != 0) return (error); diff --git a/sys/msdosfs/msdosfs_vnops.c b/sys/msdosfs/msdosfs_vnops.c index 1e2f568d340..08b83f9725e 100644 --- a/sys/msdosfs/msdosfs_vnops.c +++ b/sys/msdosfs/msdosfs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: msdosfs_vnops.c,v 1.39 2003/04/26 10:23:07 tedu Exp $ */ +/* $OpenBSD: msdosfs_vnops.c,v 1.40 2003/05/07 22:16:26 deraadt Exp $ */ /* $NetBSD: msdosfs_vnops.c,v 1.63 1997/10/17 11:24:19 ws Exp $ */ /*- @@ -1499,11 +1499,13 @@ msdosfs_readdir(v) switch (n) { case 0: dirbuf.d_namlen = 1; - strcpy(dirbuf.d_name, "."); + strlcpy(dirbuf.d_name, ".", + sizeof dirbuf.d_name); break; case 1: dirbuf.d_namlen = 2; - strcpy(dirbuf.d_name, ".."); + strlcpy(dirbuf.d_name, "..", + sizeof dirbuf.d_name); break; } dirbuf.d_reclen = DIRENT_SIZE(&dirbuf); |