summaryrefslogtreecommitdiffstats
path: root/lib/libsqlite3/src/bitvec.c
diff options
context:
space:
mode:
authorjturner <jturner@openbsd.org>2015-09-12 02:08:34 +0000
committerjturner <jturner@openbsd.org>2015-09-12 02:08:34 +0000
commit9002a9ec67ed1654a017252f6e4bc93deef91d2a (patch)
tree775f5d1fe0cf77f56c7617f4e867764206a537c7 /lib/libsqlite3/src/bitvec.c
parentadd missing functions to NAME; (diff)
downloadwireguard-openbsd-9002a9ec67ed1654a017252f6e4bc93deef91d2a.tar.xz
wireguard-openbsd-9002a9ec67ed1654a017252f6e4bc93deef91d2a.zip
Update sqlite3 to 3.8.11.1. Bump major, regen .pc and header. Changes
available here: http://sqlite.org/changes.html Tested in bulk by aja@. ok landry@ "Please crank sqlite when you get this mail." deraadt@
Diffstat (limited to 'lib/libsqlite3/src/bitvec.c')
-rw-r--r--lib/libsqlite3/src/bitvec.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/libsqlite3/src/bitvec.c b/lib/libsqlite3/src/bitvec.c
index 52184aa964c..fd908f791b3 100644
--- a/lib/libsqlite3/src/bitvec.c
+++ b/lib/libsqlite3/src/bitvec.c
@@ -126,10 +126,10 @@ Bitvec *sqlite3BitvecCreate(u32 iSize){
** If p is NULL (if the bitmap has not been created) or if
** i is out of range, then return false.
*/
-int sqlite3BitvecTest(Bitvec *p, u32 i){
- if( p==0 ) return 0;
- if( i>p->iSize || i==0 ) return 0;
+int sqlite3BitvecTestNotNull(Bitvec *p, u32 i){
+ assert( p!=0 );
i--;
+ if( i>=p->iSize ) return 0;
while( p->iDivisor ){
u32 bin = i/p->iDivisor;
i = i%p->iDivisor;
@@ -149,6 +149,9 @@ int sqlite3BitvecTest(Bitvec *p, u32 i){
return 0;
}
}
+int sqlite3BitvecTest(Bitvec *p, u32 i){
+ return p!=0 && sqlite3BitvecTestNotNull(p,i);
+}
/*
** Set the i-th bit. Return 0 on success and an error code if
@@ -341,7 +344,7 @@ int sqlite3BitvecBuiltinTest(int sz, int *aOp){
** bits to act as the reference */
pBitvec = sqlite3BitvecCreate( sz );
pV = sqlite3MallocZero( (sz+7)/8 + 1 );
- pTmpSpace = sqlite3_malloc(BITVEC_SZ);
+ pTmpSpace = sqlite3_malloc64(BITVEC_SZ);
if( pBitvec==0 || pV==0 || pTmpSpace==0 ) goto bitvec_end;
/* NULL pBitvec tests */