summaryrefslogtreecommitdiff
path: root/sys/arch/mvme88k
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2003-06-01 17:00:41 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2003-06-01 17:00:41 +0000
commit173d01b7c1e9a5d7ba5a6c696a8019061dc41bda (patch)
tree8c8b7bb08108dca24afcee3bbe301e8ba6f76e81 /sys/arch/mvme88k
parent3e42965de9054a39afc4957c4f099218e709ae51 (diff)
strcpy/strcat/sprintf removal in all bootblocks. various testing by
various people. outside of some messy things in src/gnu, only one thing in the main tree now violates this rule: bind
Diffstat (limited to 'sys/arch/mvme88k')
-rw-r--r--sys/arch/mvme88k/stand/installboot/installboot.c6
-rw-r--r--sys/arch/mvme88k/stand/wrtvid/wrtvid.c8
2 files changed, 7 insertions, 7 deletions
diff --git a/sys/arch/mvme88k/stand/installboot/installboot.c b/sys/arch/mvme88k/stand/installboot/installboot.c
index 19fc29f7f66..760a5d32ee8 100644
--- a/sys/arch/mvme88k/stand/installboot/installboot.c
+++ b/sys/arch/mvme88k/stand/installboot/installboot.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: installboot.c,v 1.6 2002/03/14 03:15:57 millert Exp $ */
+/* $OpenBSD: installboot.c,v 1.7 2003/06/01 17:00:37 deraadt Exp $ */
/* $NetBSD: installboot.c,v 1.5 1995/11/17 23:23:50 gwr Exp $ */
/*
@@ -121,7 +121,7 @@ main(argc, argv)
boot = argv[optind];
proto = argv[optind + 1];
dev = argv[optind + 2];
- strcpy(cdev, dev);
+ strlcpy(cdev, dev, sizeof cdev);
cdev[strlen(cdev)-1] = 'c';
if (verbose) {
@@ -423,7 +423,7 @@ char *bootproto;
pcpul->version = 1;
- strcpy(pcpul->vid_id, "M88K");
+ memcpy(pcpul->vid_id, "M88K", sizeof pcpul->vid_id);
fstat(exe_file, &stat);
diff --git a/sys/arch/mvme88k/stand/wrtvid/wrtvid.c b/sys/arch/mvme88k/stand/wrtvid/wrtvid.c
index 420ff803c6f..cc27853dcc2 100644
--- a/sys/arch/mvme88k/stand/wrtvid/wrtvid.c
+++ b/sys/arch/mvme88k/stand/wrtvid/wrtvid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wrtvid.c,v 1.3 1998/08/22 08:52:56 smurph Exp $ */
+/* $OpenBSD: wrtvid.c,v 1.4 2003/06/01 17:00:37 deraadt Exp $ */
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
@@ -38,16 +38,16 @@ main(argc, argv)
perror(filename);
exit(2);
}
- sprintf(fileext, "%c%cboot", filename[4], filename[5]);
+ snprintf(fileext, sizeof fileext, "%c%cboot", filename[4], filename[5]);
tape_vid = open(fileext, O_WRONLY|O_CREAT|O_TRUNC, 0644);
- sprintf(fileext, "boot%c%c", filename[4], filename[5]);
+ snprintf(fileext, sizeof fileext, "boot%c%c", filename[4], filename[5]);
tape_exe = open(fileext, O_WRONLY|O_CREAT|O_TRUNC,0644);
pcpul = (struct cpu_disklabel *)malloc(sizeof(struct cpu_disklabel));
bzero(pcpul, sizeof(struct cpu_disklabel));
pcpul->version = 1;
- strcpy(pcpul->vid_id, "M88K");
+ memcpy(pcpul->vid_id, "M88K", sizeof pcpul->vid_id);
fstat(exe_file, &stat);
/* size in 256 byte blocks round up after a.out header removed */