aboutsummaryrefslogtreecommitdiff
path: root/src/hash.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2009-04-28 17:33:16 +0000
committerdrh <drh@noemail.net>2009-04-28 17:33:16 +0000
commit0d59d17c41c87d0ae17bcc6d2697cad5c007b059 (patch)
treeec84785fda9c7a88cd809ff4d18d6ed7b31633d2 /src/hash.c
parent8be0245db4e97644bb0ca80d4b8f2fc212f1787f (diff)
downloadsqlite-0d59d17c41c87d0ae17bcc6d2697cad5c007b059.tar.gz
sqlite-0d59d17c41c87d0ae17bcc6d2697cad5c007b059.zip
Fix asserts in hash.c so that zero-length symbols can be used. (CVS 6563)
FossilOrigin-Name: fe9f00aa369051beee09ab3d1a2e046a1f679a40
Diffstat (limited to 'src/hash.c')
-rw-r--r--src/hash.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/hash.c b/src/hash.c
index 9d9be94e7..8be6dab34 100644
--- a/src/hash.c
+++ b/src/hash.c
@@ -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{