summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>1997-10-22 23:48:41 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>1997-10-22 23:48:41 +0000
commit9f7b8f31207014f09b0c8ed8618d64661e255c1a (patch)
tree1a5e65a06ca24d78cc112ed9c2684f77f7d6abd4
parent8509cbbe2916709cbf09267f0cc85c07802107ac (diff)
fix makebootargs
-rw-r--r--sys/stand/boot/bootarg.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/sys/stand/boot/bootarg.c b/sys/stand/boot/bootarg.c
index 1012d458d6f..e74368cb4fa 100644
--- a/sys/stand/boot/bootarg.c
+++ b/sys/stand/boot/bootarg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bootarg.c,v 1.1 1997/10/21 04:05:53 mickey Exp $ */
+/* $OpenBSD: bootarg.c,v 1.2 1997/10/22 23:48:40 mickey Exp $ */
/*
* Copyright (c) 1997 Michael Shalayeff
@@ -47,7 +47,7 @@ addbootarg(t, l, p)
q->ba_type = t;
q->ba_size = sizeof(*q) + l - sizeof(q->ba_arg);
- memcpy(q->ba_arg, p, l);
+ bcopy(p, q->ba_arg, l);
q->ba_next = list;
list = q;
}
@@ -63,11 +63,16 @@ makebootargs(lenp)
*lenp = 0;
for (p = list; p != NULL; p = p->ba_next)
*lenp += p->ba_size;
- r = alloc(*lenp + sizeof(p->ba_type));
+ r = alloc(*lenp += sizeof(*p));
/* copy them out */
- for (p = list, q = r; p != NULL; p = p->ba_next, q += p->ba_size)
- memcpy(q, p, p->ba_size);
- *(int *)q = BOOTARG_END;
+ for (p = list, q = r; p != NULL; q += p->ba_size, p = p->ba_next) {
+#ifdef DEBUG
+ printf("%d,%d ", p->ba_type, p->ba_size);
+#endif
+ bcopy(p, q, p->ba_size);
+ }
+ p = (bootarg_t *)q;
+ p->ba_type = BOOTARG_END;
return r;
}