-/* $OpenBSD: btree.c,v 1.28 2010/07/18 15:15:40 martinh Exp $ */
+/* $OpenBSD: btree.c,v 1.29 2010/07/26 09:27:14 martinh Exp $ */
/*
* Copyright (c) 2009, 2010 Martin Hedenfalk <martin@bzero.se>
{
ssize_t rc;
indx_t i;
- pgno_t *pnext;
+ pgno_t *pnext, next;
struct node *node;
struct page *p;
struct mpage *mp;
for (i = 0; i < NUMKEYSP(p); i++) {
node = NODEPTRP(p, i);
if (F_ISSET(node->flags, F_BIGDATA)) {
- pnext = NODEDATA(node);
- *pnext = btree_compact_tree(bt, *pnext, btc);
- if (*pnext == P_INVALID) {
+ bcopy(NODEDATA(node), &next, sizeof(next));
+ next = btree_compact_tree(bt, next, btc);
+ if (next == P_INVALID) {
free(p);
return P_INVALID;
}
+ bcopy(&next, NODEDATA(node), sizeof(next));
}
}
} else if (F_ISSET(p->flags, P_OVERFLOW)) {