aboutsummaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2014-10-24 00:35:58 +0000
committerdrh <drh@noemail.net>2014-10-24 00:35:58 +0000
commit9ca95730e3a25bf5b335ec73a0a14f0112a421fb (patch)
tree3d17fb8a23416f52cd800470fb9509d646fe2800 /src/util.c
parent4f81bbb5289cdd248c21775b9e4cdb92e110e139 (diff)
downloadsqlite-9ca95730e3a25bf5b335ec73a0a14f0112a421fb.tar.gz
sqlite-9ca95730e3a25bf5b335ec73a0a14f0112a421fb.zip
Add the SQLITE_ENABLE_API_ARMOR compile-time option. This is a work in
progress and is not yet completely functional. FossilOrigin-Name: c297a84bc678f81ffc0aa9139ab73f0ca87c1971
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/util.c b/src/util.c
index 9bb8d8915..ab409fa25 100644
--- a/src/util.c
+++ b/src/util.c
@@ -251,6 +251,11 @@ int sqlite3Dequote(char *z){
*/
int sqlite3_stricmp(const char *zLeft, const char *zRight){
register unsigned char *a, *b;
+ if( zLeft==0 ){
+ return zRight ? -1 : 0;
+ }else if( zRight==0 ){
+ return 1;
+ }
a = (unsigned char *)zLeft;
b = (unsigned char *)zRight;
while( *a!=0 && UpperToLower[*a]==UpperToLower[*b]){ a++; b++; }
@@ -258,6 +263,11 @@ int sqlite3_stricmp(const char *zLeft, const char *zRight){
}
int sqlite3_strnicmp(const char *zLeft, const char *zRight, int N){
register unsigned char *a, *b;
+ if( zLeft==0 ){
+ return zRight ? -1 : 0;
+ }else if( zRight==0 ){
+ return 1;
+ }
a = (unsigned char *)zLeft;
b = (unsigned char *)zRight;
while( N-- > 0 && *a!=0 && UpperToLower[*a]==UpperToLower[*b]){ a++; b++; }