Make sure large negative arguments to PRAGMA cache_size do not cause
32-bit signed integer overflow. Also correct a requirements mark.
FossilOrigin-Name: 17c30634a71051158f8d37fd51b3c2a125ad8bd2
diff --git a/src/main.c b/src/main.c
index 7da925c..524b710 100644
--- a/src/main.c
+++ b/src/main.c
@@ -49,7 +49,7 @@
*/
int sqlite3_libversion_number(void){ return SQLITE_VERSION_NUMBER; }
-/* IMPLEMENTATION-OF: R-54823-41343 The sqlite3_threadsafe() function returns
+/* IMPLEMENTATION-OF: R-20790-14025 The sqlite3_threadsafe() function returns
** zero if and only if SQLite was compiled with mutexing code omitted due to
** the SQLITE_THREADSAFE compile-time option being set to 0.
*/
diff --git a/src/pcache.c b/src/pcache.c
index 0c3e9ee..482a188 100644
--- a/src/pcache.c
+++ b/src/pcache.c
@@ -205,7 +205,7 @@
if( p->szCache>=0 ){
return p->szCache;
}else{
- return (-1024*p->szCache)/(p->szPage+p->szExtra);
+ return (int)((-1024*(i64)p->szCache)/(p->szPage+p->szExtra));
}
}