From 9a97bdbd9dd93aa37e31e91bf44ea0fb3abc3721 Mon Sep 17 00:00:00 2001 From: Michael Shalayeff Date: Sun, 17 Aug 2003 23:43:46 +0000 Subject: fix ptr arythmetics in core_write(); from aaron@ --- usr.bin/pmdb/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/pmdb/core.c b/usr.bin/pmdb/core.c index 21763b25147..7425fe748d4 100644 --- a/usr.bin/pmdb/core.c +++ b/usr.bin/pmdb/core.c @@ -1,4 +1,4 @@ -/* $OpenBSD: core.c,v 1.5 2003/03/29 00:01:46 mickey Exp $ */ +/* $OpenBSD: core.c,v 1.6 2003/08/17 23:43:45 mickey Exp $ */ /* * Copyright (c) 2002 Jean-Francois Brousseau * All rights reserved. @@ -183,7 +183,7 @@ core_write(struct pstate *ps, off_t to, void *from, size_t size) cs = ps->ps_core->segs[i]; if ((to > cs->c_addr) && (to < (cs->c_addr + cs->c_size))) { written = size; - fp = cs + sizeof(*cs) + (to - cs->c_addr); + fp = (void *)cs + sizeof(*cs) + (to - cs->c_addr); memcpy(fp, from, written); return (written); } -- cgit v1.2.3