From 41fea8c64985e338671cb9e07547bf4b156a1546 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Fri, 13 Jun 1997 13:01:30 +0000 Subject: strncpy --- lib/libc/gen/fstab.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib') 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 @@ -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) -- cgit v1.2.3