1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Fix tool/showwal.c so that it handles WAL files that contain 64KiB pages.

FossilOrigin-Name: 4060efb646c873c4abde7ab9ddf330489a44f274
This commit is contained in:
dan
2014-09-15 16:53:23 +00:00
parent ed7bcba798
commit b6dea49f3d
3 changed files with 11 additions and 11 deletions

View File

@ -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);