summaryrefslogtreecommitdiff
path: root/sys/arch/macppc/stand/hfs.c
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/macppc/stand/hfs.c
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/macppc/stand/hfs.c')
-rw-r--r--sys/arch/macppc/stand/hfs.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/arch/macppc/stand/hfs.c b/sys/arch/macppc/stand/hfs.c
index de677b7fe74..da3116e3297 100644
--- a/sys/arch/macppc/stand/hfs.c
+++ b/sys/arch/macppc/stand/hfs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hfs.c,v 1.1 2001/09/01 15:39:02 drahn Exp $ */
+/* $OpenBSD: hfs.c,v 1.2 2003/06/01 17:00:36 deraadt Exp $ */
/* $NetBSD: hfs.c,v 1.1 2000/11/14 11:25:35 tsubai Exp $ */
/*-
@@ -44,7 +44,6 @@ hfs_open(path, f)
int chosen;
char bootpath[128], *cp;
-
if ((chosen = OF_finddevice("/chosen")) == -1)
return ENXIO;
bzero(bootpath, sizeof bootpath);
@@ -54,7 +53,7 @@ hfs_open(path, f)
cp = strrchr(bootpath, ',');
#else
cp = bootpath;
- cp += strlen (bootpath);
+ cp += strlen(bootpath);
for (; *cp != ','; cp--) {
if (cp == bootpath) {
cp = NULL;
@@ -65,11 +64,10 @@ hfs_open(path, f)
if (cp == NULL)
return ENXIO;
- strcpy(cp + 1, path);
+ strlcpy(cp + 1, path, bootpath + sizeof bootpath - (cp + 1));
OF_fd = OF_open(bootpath);
if (OF_fd == -1)
return ENOENT;
-
return 0;
}