1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-16 23:02:26 +03:00

Fix asserts in hash.c so that zero-length symbols can be used. (CVS 6563)

FossilOrigin-Name: fe9f00aa369051beee09ab3d1a2e046a1f679a40
This commit is contained in:
drh
2009-04-28 17:33:16 +00:00
parent 8be0245db4
commit 0d59d17c41
3 changed files with 12 additions and 12 deletions

View File

@@ -12,7 +12,7 @@
** This is the implementation of generic hash-tables
** used in SQLite.
**
** $Id: hash.c,v 1.35 2009/04/28 15:43:45 drh Exp $
** $Id: hash.c,v 1.36 2009/04/28 17:33:16 drh Exp $
*/
#include "sqliteInt.h"
#include <assert.h>
@@ -63,7 +63,7 @@ void sqlite3HashClear(Hash *pH){
static unsigned int strHash(const void *pKey, int nKey){
const char *z = (const char *)pKey;
int h = 0;
assert( nKey>0 );
assert( nKey>=0 );
while( nKey > 0 ){
h = (h<<3) ^ h ^ sqlite3UpperToLower[(unsigned char)*z++];
nKey--;
@@ -222,7 +222,7 @@ void *sqlite3HashFind(const Hash *pH, const void *pKey, int nKey){
assert( pH!=0 );
assert( pKey!=0 );
assert( nKey>0 );
assert( nKey>=0 );
if( pH->ht ){
h = strHash(pKey, nKey) % pH->htsize;
}else{
@@ -254,7 +254,7 @@ void *sqlite3HashInsert(Hash *pH, const void *pKey, int nKey, void *data){
assert( pH!=0 );
assert( pKey!=0 );
assert( nKey>0 );
assert( nKey>=0 );
if( pH->htsize ){
h = strHash(pKey, nKey) % pH->htsize;
}else{