1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-09 14:21:03 +03:00

Make sure hash functions always return non-negative. (CVS 969)

FossilOrigin-Name: 39a3e403f0440acb2f85a064ec23d404f9cdfbc4
This commit is contained in:
drh
2003-05-12 23:06:52 +00:00
parent 5ca89c3d28
commit 5364f60302
4 changed files with 13 additions and 15 deletions

View File

@@ -14,7 +14,7 @@
** This file contains functions for allocating memory, comparing
** strings, and stuff like that.
**
** $Id: util.c,v 1.62 2003/04/18 17:45:14 drh Exp $
** $Id: util.c,v 1.63 2003/05/12 23:06:53 drh Exp $
*/
#include "sqliteInt.h"
#include <stdarg.h>
@@ -588,8 +588,7 @@ int sqliteHashNoCase(const char *z, int n){
h = (h<<3) ^ h ^ UpperToLower[(unsigned char)*z++];
n--;
}
if( h<0 ) h = -h;
return h;
return h & 0x7fffffff;
}
/*