#include <sys/param.h>
#include <stdio.h>
+#include <string.h>
#include "db-int.h"
#include "btree.h"
indx_t i, top;
u_char flags;
char *p;
+ u_int32_t ksize;
if (!F_ISSET(((BTREE *)t), B_NEEDSWAP))
return;
M_16_SWAP(h->linp[i]);
p = (char *)GETBLEAF(h, i);
P_32_SWAP(p);
+ memcpy(&ksize, p, sizeof(ksize));
p += sizeof(u_int32_t);
P_32_SWAP(p);
p += sizeof(u_int32_t);
p += sizeof(u_char);
if (flags & P_BIGKEY) {
P_32_SWAP(p);
- p += sizeof(db_pgno_t);
- P_32_SWAP(p);
+ P_32_SWAP(p + sizeof(db_pgno_t));
}
if (flags & P_BIGDATA) {
- p += sizeof(u_int32_t);
+ p += ksize;
P_32_SWAP(p);
p += sizeof(db_pgno_t);
P_32_SWAP(p);
indx_t i, top;
u_char flags;
char *p;
+ u_int32_t ksize;
if (!F_ISSET(((BTREE *)t), B_NEEDSWAP))
return;
}
else if ((h->flags & P_TYPE) == P_BLEAF)
for (i = 0; i < top; i++) {
+ ksize = GETBLEAF(h, i)->ksize;
p = (char *)GETBLEAF(h, i);
P_32_SWAP(p);
p += sizeof(u_int32_t);
p += sizeof(u_char);
if (flags & P_BIGKEY) {
P_32_SWAP(p);
- p += sizeof(db_pgno_t);
- P_32_SWAP(p);
+ P_32_SWAP(p + sizeof(db_pgno_t));
}
if (flags & P_BIGDATA) {
- p += sizeof(u_int32_t);
+ p += ksize;
P_32_SWAP(p);
p += sizeof(db_pgno_t);
P_32_SWAP(p);