summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1997-06-13 13:01:30 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1997-06-13 13:01:30 +0000
commit41fea8c64985e338671cb9e07547bf4b156a1546 (patch)
tree64c72027cedbb2d0c5cfd24eddc209a855424718
parent806f6529ad292c7df19c23a75acf8d9ca7a80d40 (diff)
strncpy
-rw-r--r--lib/libc/gen/fstab.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libc/gen/fstab.c b/lib/libc/gen/fstab.c
index 33786d3c595..9bb4a63e8a1 100644
--- a/lib/libc/gen/fstab.c
+++ b/lib/libc/gen/fstab.c
@@ -32,7 +32,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: fstab.c,v 1.3 1996/08/19 08:22:51 tholo Exp $";
+static char rcsid[] = "$OpenBSD: fstab.c,v 1.4 1997/06/13 13:01:29 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@@ -102,7 +102,8 @@ fstabscan()
if ((cp = strtok((char *)NULL, " \t\n")) != NULL)
_fs_fstab.fs_passno = atoi(cp);
}
- strcpy(subline, _fs_fstab.fs_mntops);
+ stnrcpy(subline, _fs_fstab.fs_mntops, sizeof subline-1);
+ subline[sizeof subline-1] = '\0';
for (typexx = 0, cp = strtok(subline, ","); cp;
cp = strtok((char *)NULL, ",")) {
if (strlen(cp) != 2)