summaryrefslogtreecommitdiff
path: root/sbin/restore
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>1998-12-16 04:48:00 +0000
committerWarner Losh <imp@FreeBSD.org>1998-12-16 04:48:00 +0000
commite25459682488d1c10534f3294fd082d0ad662694 (patch)
treecd3b07ab876cc613966d96692bd6e0891dc3bc0c /sbin/restore
parenta207266e911e3556eab407a47f43f6d64982951b (diff)
downloadsrc-test2-e25459682488d1c10534f3294fd082d0ad662694.tar.gz
src-test2-e25459682488d1c10534f3294fd082d0ad662694.zip
Notes
Diffstat (limited to 'sbin/restore')
-rw-r--r--sbin/restore/interactive.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sbin/restore/interactive.c b/sbin/restore/interactive.c
index 763ca13a3fee..1d6424db239a 100644
--- a/sbin/restore/interactive.c
+++ b/sbin/restore/interactive.c
@@ -36,7 +36,7 @@
static char sccsid[] = "@(#)interactive.c 8.5 (Berkeley) 5/1/95";
#endif
static const char rcsid[] =
- "$Id: interactive.c,v 1.5 1998/07/28 06:20:08 charnier Exp $";
+ "$Id: interactive.c,v 1.6 1998/09/17 20:18:11 imp Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -343,7 +343,8 @@ getcmd(curdir, cmd, name, size, ap)
* If no argument, use curdir as the default.
*/
if (*cp == '\0') {
- (void) strcpy(name, curdir);
+ (void) strncpy(name, curdir, size);
+ name[size - 1] = '\0';
return;
}
nextarg = cp;
@@ -377,7 +378,8 @@ getnext:
ap->argcnt = ap->glob.gl_pathc;
retnext:
- strcpy(name, ap->glob.gl_pathv[ap->glob.gl_pathc - ap->argcnt]);
+ strncpy(name, ap->glob.gl_pathv[ap->glob.gl_pathc - ap->argcnt], size);
+ name[size - 1] = '\0';
if (--ap->argcnt == 0) {
ap->freeglob = 0;
globfree(&ap->glob);