summaryrefslogtreecommitdiff
path: root/sbin/scsi/scsi.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/scsi/scsi.c
parentda8bb9c6524889ac263619304fb47655a50b836a (diff)
more strlcpy; most from Hans-Joerg.Hoexer@yerbouti.franken.de, a bit from me
Diffstat (limited to 'sbin/scsi/scsi.c')
-rw-r--r--sbin/scsi/scsi.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sbin/scsi/scsi.c b/sbin/scsi/scsi.c
index f46cccccf36..c530c0beb66 100644
--- a/sbin/scsi/scsi.c
+++ b/sbin/scsi/scsi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scsi.c,v 1.9 2003/02/20 21:47:27 millert Exp $ */
+/* $OpenBSD: scsi.c,v 1.10 2003/03/13 05:00:45 deraadt Exp $ */
/* $FreeBSD: scsi.c,v 1.11 1996/04/06 11:00:28 joerg Exp $ */
/*
@@ -651,7 +651,7 @@ edit_init(void)
int fd;
edit_rewind();
- strcpy(edit_name, "/var/tmp/scXXXXXXXX");
+ strlcpy(edit_name, "/var/tmp/scXXXXXXXX", sizeof edit_name);
if ((fd = mkstemp(edit_name)) == -1) {
perror("mkstemp failed");
exit(errno);
@@ -745,8 +745,7 @@ edit_edit(void)
fclose(edit_file);
- system_line = malloc(strlen(editor) + strlen(edit_name) + 6);
- sprintf(system_line, "%s %s", editor, edit_name);
+ asprintf(&system_line, "%s %s", editor, edit_name);
system(system_line);
free(system_line);