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

Fix an issue with the new sqlite3Strlen30() introduced by

check-in (6007).  Additional casts for compiler warnings. (CVS 6011)

FossilOrigin-Name: 258722b6178f60eaccef1675aab3edc456d413a5
This commit is contained in:
drh
2008-12-10 22:15:00 +00:00
parent 1bd10f8a00
commit 4f21c4af30
9 changed files with 98 additions and 88 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.244 2008/12/10 21:19:57 drh Exp $
** $Id: util.c,v 1.245 2008/12/10 22:15:00 drh Exp $
*/
#include "sqliteInt.h"
#include <stdarg.h>
@@ -50,6 +50,16 @@ int sqlite3IsNaN(double x){
return y!=z;
}
/*
** Compute a string length that is limited to what can be stored in
** lower 30 bits of a 32-bit signed integer.
*/
int sqlite3Strlen30(const char *z){
const char *z2 = z;
while( *z2 ){ z2++; }
return 0x3fffffff & (int)(z2 - z);
}
/*
** Return the length of a string, except do not allow the string length
** to exceed the SQLITE_LIMIT_LENGTH setting.