diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2001-05-11 18:40:47 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2001-05-11 18:40:47 +0000 |
commit | 6550503d6d072f8e62e9012db00bb19fc859dbae (patch) | |
tree | 981c7144c378c685e2346450deb74639f02ec7ac /bin | |
parent | 6f2108293d9fc5835f4beb6b69f733f7ed571c09 (diff) |
use strlcpy instead of strncpy+a[len-1]='\0'
Diffstat (limited to 'bin')
-rw-r--r-- | bin/df/ext2fs_df.c | 5 | ||||
-rw-r--r-- | bin/df/ffs_df.c | 5 | ||||
-rw-r--r-- | bin/df/lfs_df.c | 5 |
3 files changed, 6 insertions, 9 deletions
diff --git a/bin/df/ext2fs_df.c b/bin/df/ext2fs_df.c index 60bef0bf5e2..de3612862c6 100644 --- a/bin/df/ext2fs_df.c +++ b/bin/df/ext2fs_df.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ext2fs_df.c,v 1.6 2001/01/28 23:04:55 niklas Exp $ */ +/* $OpenBSD: ext2fs_df.c,v 1.7 2001/05/11 18:40:46 mickey Exp $ */ /* * This file is substantially derived from src/sys/ufs/ext2fs/ext2fs_vfsops.c:e2fs_statfs(). @@ -108,7 +108,6 @@ e2fs_df(rfd, file, sfsp) mntpt = ""; memmove(&sfsp->f_mntonname[0], mntpt, MNAMELEN); memmove(&sfsp->f_mntfromname[0], file, MNAMELEN); - strncpy(sfsp->f_fstypename, MOUNT_EXT2FS, MFSNAMELEN-1); - sfsp->f_fstypename[MFSNAMELEN-1] = '\0'; + strlcpy(sfsp->f_fstypename, MOUNT_EXT2FS, MFSNAMELEN); return (0); } diff --git a/bin/df/ffs_df.c b/bin/df/ffs_df.c index f166b0c657d..b4081f7f019 100644 --- a/bin/df/ffs_df.c +++ b/bin/df/ffs_df.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ffs_df.c,v 1.5 2001/01/28 23:04:55 niklas Exp $ */ +/* $OpenBSD: ffs_df.c,v 1.6 2001/05/11 18:40:46 mickey Exp $ */ /* * Copyright (c) 1980, 1990, 1993, 1994 @@ -95,7 +95,6 @@ ffs_df(rfd, file, sfsp) mntpt = ""; memmove(&sfsp->f_mntonname[0], mntpt, MNAMELEN); memmove(&sfsp->f_mntfromname[0], file, MNAMELEN); - strncpy(sfsp->f_fstypename, MOUNT_FFS, MFSNAMELEN-1); - sfsp->f_fstypename[MFSNAMELEN-1] = '\0'; + strlcpy(sfsp->f_fstypename, MOUNT_FFS, MFSNAMELEN); return (0); } diff --git a/bin/df/lfs_df.c b/bin/df/lfs_df.c index d876105f803..f5824fd8bf0 100644 --- a/bin/df/lfs_df.c +++ b/bin/df/lfs_df.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lfs_df.c,v 1.5 2001/01/28 23:04:55 niklas Exp $ */ +/* $OpenBSD: lfs_df.c,v 1.6 2001/05/11 18:40:46 mickey Exp $ */ /* * This file is substantially duplicated from src/sys/ufs/lfs/lfs_vfsops.c:lfs_statfs(). @@ -97,7 +97,6 @@ lfs_df(rfd, file, sfsp) mntpt = ""; memmove(&sfsp->f_mntonname[0], mntpt, MNAMELEN); memmove(&sfsp->f_mntfromname[0], file, MNAMELEN); - strncpy(sfsp->f_fstypename, MOUNT_LFS, MFSNAMELEN-1); - sfsp->f_fstypename[MFSNAMELEN-1] = '\0'; + strlcpy(sfsp->f_fstypename, MOUNT_LFS, MFSNAMELEN); return (0); } |