aboutsummaryrefslogtreecommitdiff
path: root/tool
diff options
context:
space:
mode:
authordan <Dan Kennedy>2025-02-12 20:19:57 +0000
committerdan <Dan Kennedy>2025-02-12 20:19:57 +0000
commit25367c1eb04aa55b47d1e253e5e85cf9e6d7228b (patch)
tree8d0502ceb69f1a7583d3963b8448dd10a6bb1e0e /tool
parent1be96b44c198a20f8fd567b319ba9fcb82ffa09e (diff)
downloadsqlite-25367c1eb04aa55b47d1e253e5e85cf9e6d7228b.tar.gz
sqlite-25367c1eb04aa55b47d1e253e5e85cf9e6d7228b.zip
Fix a few 32-bit overflow problems in showdb.c.
FossilOrigin-Name: 9377766647eeaa575d646cf5f66c3163ef7074930aa5c3b11073e6b1e90ce799
Diffstat (limited to 'tool')
-rw-r--r--tool/showdb.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/tool/showdb.c b/tool/showdb.c
index 12c2e271b..f0bd9737c 100644
--- a/tool/showdb.c
+++ b/tool/showdb.c
@@ -27,7 +27,7 @@ typedef sqlite3_uint64 u64; /* unsigned 64-bit */
static struct GlobalData {
- u32 pagesize; /* Size of a database page */
+ i64 pagesize; /* Size of a database page */
int dbfd; /* File descriptor for reading the DB */
u32 mxPage; /* Last page number */
int perLine; /* HEX elements to print per line */
@@ -1178,7 +1178,7 @@ int main(int argc, char **argv){
if( g.pagesize==0 ) g.pagesize = 1024;
sqlite3_free(zPgSz);
- printf("Pagesize: %d\n", g.pagesize);
+ printf("Pagesize: %d\n", (int)g.pagesize);
g.mxPage = (u32)((szFile+g.pagesize-1)/g.pagesize);
printf("Available pages: 1..%u\n", g.mxPage);
@@ -1218,7 +1218,8 @@ int main(int argc, char **argv){
iEnd = strtol(&zLeft[2], 0, 0);
checkPageValidity(iEnd);
}else if( zLeft && zLeft[0]=='b' ){
- int ofst, nByte, hdrSize;
+ i64 ofst;
+ int nByte, hdrSize;
unsigned char *a;
if( iStart==1 ){
ofst = hdrSize = 100;