summaryrefslogtreecommitdiff
path: root/sbin/restore/tape.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2003-03-13 05:00:46 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2003-03-13 05:00:46 +0000
commitcb6e8175ac10701d65b5fec5e46d51be5bf0c9df (patch)
tree80b99f1a91fa55eb600bdf0ea73fddddbb4d17d7 /sbin/restore/tape.c
parentda8bb9c6524889ac263619304fb47655a50b836a (diff)
more strlcpy; most from Hans-Joerg.Hoexer@yerbouti.franken.de, a bit from me
Diffstat (limited to 'sbin/restore/tape.c')
-rw-r--r--sbin/restore/tape.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/sbin/restore/tape.c b/sbin/restore/tape.c
index 713066bd44e..d0cb7ec5374 100644
--- a/sbin/restore/tape.c
+++ b/sbin/restore/tape.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tape.c,v 1.21 2002/02/19 19:39:38 millert Exp $ */
+/* $OpenBSD: tape.c,v 1.22 2003/03/13 05:00:44 deraadt Exp $ */
/* $NetBSD: tape.c,v 1.26 1997/04/15 07:12:25 lukem Exp $ */
/*
@@ -148,7 +148,7 @@ setinput(source)
}
pipein++;
}
- (void)strcpy(magtape, source);
+ (void)strlcpy(magtape, source, sizeof magtape);
}
void
@@ -309,11 +309,11 @@ again:
" towards the first.\n");
} else {
fprintf(stderr, "You have read volumes");
- strcpy(buf, ": ");
+ strlcpy(buf, ": ", sizeof buf);
for (i = 1; i < 32; i++)
if (tapesread & (1 << i)) {
fprintf(stderr, "%s%ld", buf, i);
- strcpy(buf, ", ");
+ strlcpy(buf, ", ", sizeof buf);
}
fprintf(stderr, "\n");
}
@@ -346,10 +346,9 @@ again:
terminateinput();
return;
}
- if (buf[0] != '\n') {
- (void)strcpy(magtape, buf);
- magtape[strlen(magtape) - 1] = '\0';
- }
+ if (buf[0] != '\n')
+ (void)strlcpy(magtape, buf, sizeof magtape);
+
#ifdef RRESTORE
if (host)
mt = rmtopen(magtape, 0);