summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bin/df/ext2fs_df.c5
-rw-r--r--bin/df/ffs_df.c5
-rw-r--r--bin/df/lfs_df.c5
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);
}