diff options
author | dan <dan@noemail.net> | 2014-09-15 16:53:23 +0000 |
---|---|---|
committer | dan <dan@noemail.net> | 2014-09-15 16:53:23 +0000 |
commit | b6dea49f3d30bd348676eb5c6795f6f1ea5c173c (patch) | |
tree | 243a9fbe63756d96307ba70c3099aadb93373fb5 /tool/showwal.c | |
parent | ed7bcba7980a59d400b592e7306d72e1599678fd (diff) | |
download | sqlite-b6dea49f3d30bd348676eb5c6795f6f1ea5c173c.tar.gz sqlite-b6dea49f3d30bd348676eb5c6795f6f1ea5c173c.zip |
Fix tool/showwal.c so that it handles WAL files that contain 64KiB pages.
FossilOrigin-Name: 4060efb646c873c4abde7ab9ddf330489a44f274
Diffstat (limited to 'tool/showwal.c')
-rw-r--r-- | tool/showwal.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tool/showwal.c b/tool/showwal.c index 6dc1de173..35810c66a 100644 --- a/tool/showwal.c +++ b/tool/showwal.c @@ -510,7 +510,7 @@ static void decode_btree_page( int main(int argc, char **argv){ struct stat sbuf; - unsigned char zPgSz[2]; + unsigned char zPgSz[4]; if( argc<2 ){ fprintf(stderr,"Usage: %s FILENAME ?PAGE? ...\n", argv[0]); exit(1); @@ -522,9 +522,9 @@ int main(int argc, char **argv){ } zPgSz[0] = 0; zPgSz[1] = 0; - lseek(fd, 10, SEEK_SET); - read(fd, zPgSz, 2); - pagesize = zPgSz[0]*256 + zPgSz[1]; + lseek(fd, 8, SEEK_SET); + read(fd, zPgSz, 4); + pagesize = zPgSz[1]*65536 + zPgSz[2]*256 + zPgSz[3]; if( pagesize==0 ) pagesize = 1024; printf("Pagesize: %d\n", pagesize); fstat(fd, &sbuf); |