summaryrefslogtreecommitdiff
path: root/sys/compat/ibcs2
diff options
context:
space:
mode:
authorPedro Martelletto <pedro@cvs.openbsd.org>2006-12-29 13:04:38 +0000
committerPedro Martelletto <pedro@cvs.openbsd.org>2006-12-29 13:04:38 +0000
commitba02f4c341ab798b8da15c745fc34262ae5a5453 (patch)
tree9473fe40366c845b982fc8384589829f15cd5fe0 /sys/compat/ibcs2
parentb7675ae17e9bbe19e88fdbe069031a9a676974c3 (diff)
Avoid void * arithmetic, okay deraadt@, suggestions from millert@
Diffstat (limited to 'sys/compat/ibcs2')
-rw-r--r--sys/compat/ibcs2/ibcs2_exec.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/compat/ibcs2/ibcs2_exec.c b/sys/compat/ibcs2/ibcs2_exec.c
index e27b4b52359..1649bbb29b0 100644
--- a/sys/compat/ibcs2/ibcs2_exec.c
+++ b/sys/compat/ibcs2/ibcs2_exec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ibcs2_exec.c,v 1.17 2003/11/18 06:26:15 tedu Exp $ */
+/* $OpenBSD: ibcs2_exec.c,v 1.18 2006/12/29 13:04:37 pedro Exp $ */
/* $NetBSD: ibcs2_exec.c,v 1.12 1996/10/12 02:13:52 thorpej Exp $ */
/*
@@ -131,7 +131,8 @@ exec_ibcs2_coff_makecmds(p, epp)
if (COFF_BADMAG(fp))
return ENOEXEC;
- ap = epp->ep_hdr + sizeof(struct coff_filehdr);
+ ap = (struct coff_aouthdr *)((char *)epp->ep_hdr +
+ sizeof(struct coff_filehdr));
switch (ap->a_magic) {
case COFF_OMAGIC:
error = exec_ibcs2_coff_prep_omagic(p, epp, fp, ap);
@@ -589,7 +590,7 @@ exec_ibcs2_xout_makecmds(p, epp)
if ((xp->x_renv & (XE_ABS | XE_VMOD)) || !(xp->x_renv & XE_EXEC))
return ENOEXEC;
- xep = epp->ep_hdr + sizeof(struct xexec);
+ xep = (struct xext *)((char *)epp->ep_hdr + sizeof(struct xexec));
#ifdef notyet
if (xp->x_renv & XE_PURE)
error = exec_ibcs2_xout_prep_zmagic(p, epp, xp, xep);