summaryrefslogtreecommitdiff
path: root/sbin/restore/interactive.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-12-16 17:11:44 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-12-16 17:11:44 +0000
commita30b546dca5879eb3e1d69bd0f307e6b85a62050 (patch)
tree78db3106ae7e7571e668906e4de1e2d24d50c332 /sbin/restore/interactive.c
parent7cd754d04eab0796fee90fb5d2fc6d2691799fce (diff)
does noone know how to use strncat correctly?
Diffstat (limited to 'sbin/restore/interactive.c')
-rw-r--r--sbin/restore/interactive.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sbin/restore/interactive.c b/sbin/restore/interactive.c
index 12888f75821..69b6657a082 100644
--- a/sbin/restore/interactive.c
+++ b/sbin/restore/interactive.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: interactive.c,v 1.2 1996/06/23 14:32:15 deraadt Exp $ */
+/* $OpenBSD: interactive.c,v 1.3 1996/12/16 17:11:43 deraadt Exp $ */
/* $NetBSD: interactive.c,v 1.9 1995/03/18 14:59:44 cgd Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)interactive.c 8.3 (Berkeley) 9/13/94";
#else
-static char rcsid[] = "$OpenBSD: interactive.c,v 1.2 1996/06/23 14:32:15 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: interactive.c,v 1.3 1996/12/16 17:11:43 deraadt Exp $";
#endif
#endif /* not lint */
@@ -536,7 +536,8 @@ printlist(name, basename)
entries = 0;
listp = list;
(void) strncpy(locname, name, MAXPATHLEN);
- (void) strncat(locname, "/", MAXPATHLEN);
+ locname[sizeof locname - 1] = '\0';
+ (void) strncat(locname, "/", MAXPATHLEN - strlen(locname));
namelen = strlen(locname);
while (dp = rst_readdir(dirp)) {
if (dp == NULL)