aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordan <dan@noemail.net>2010-04-30 16:50:00 +0000
committerdan <dan@noemail.net>2010-04-30 16:50:00 +0000
commitc9d53dbe5a232b81f33cabff27746a1052264edd (patch)
treef1380f6bf917526546074d10de56e526c45eb1c1 /src
parent400df2ea70f47060dd8c30852931b32d994881da (diff)
downloadsqlite-c9d53dbe5a232b81f33cabff27746a1052264edd.tar.gz
sqlite-c9d53dbe5a232b81f33cabff27746a1052264edd.zip
Fix a problem with calculating the required size of the wal-index when appending frames.
FossilOrigin-Name: 9526b11130f3ed2f5227386a26263c767214603a
Diffstat (limited to 'src')
-rw-r--r--src/wal.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/wal.c b/src/wal.c
index 3b57184c8..3ac18c74d 100644
--- a/src/wal.c
+++ b/src/wal.c
@@ -433,9 +433,9 @@ static int walIndexAppend(Wal *pWal, u32 iFrame, u32 iPage){
u32 iSlot = walIndexEntry(iFrame);
walIndexMap(pWal, -1);
- while( (iSlot+128)>=pWal->szWIndex ){
+ while( ((iSlot+128)*sizeof(u32))>=pWal->szWIndex ){
int rc;
- int nByte = pWal->szWIndex*4 + WALINDEX_MMAP_INCREMENT;
+ int nByte = pWal->szWIndex + WALINDEX_MMAP_INCREMENT;
/* Enlarge the storage, then remap it. */
rc = walIndexRemap(pWal, nByte);