summaryrefslogtreecommitdiffstats
path: root/lib/libsqlite3/src/util.c
diff options
context:
space:
mode:
authorjturner <jturner@openbsd.org>2015-04-04 23:24:43 +0000
committerjturner <jturner@openbsd.org>2015-04-04 23:24:43 +0000
commit4cd20ac631b4b7b4b044a0402b379984aae8c8fa (patch)
tree67f2e52b4aeaa573e6ee5b3b4172c119abef2a05 /lib/libsqlite3/src/util.c
parentThe swapfile argument is also const char *. (diff)
downloadwireguard-openbsd-4cd20ac631b4b7b4b044a0402b379984aae8c8fa.tar.xz
wireguard-openbsd-4cd20ac631b4b7b4b044a0402b379984aae8c8fa.zip
Update sqlite3 to 3.8.8.3. Changes available here:
http://sqlite.org/releaselog/3_8_8_3.html Tested in bulk and ok landry@
Diffstat (limited to 'lib/libsqlite3/src/util.c')
-rw-r--r--lib/libsqlite3/src/util.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/lib/libsqlite3/src/util.c b/lib/libsqlite3/src/util.c
index 9bb8d891577..6e64242e876 100644
--- a/lib/libsqlite3/src/util.c
+++ b/lib/libsqlite3/src/util.c
@@ -17,7 +17,7 @@
*/
#include "sqliteInt.h"
#include <stdarg.h>
-#ifdef SQLITE_HAVE_ISNAN
+#if HAVE_ISNAN || SQLITE_HAVE_ISNAN
# include <math.h>
#endif
@@ -58,7 +58,7 @@ int sqlite3FaultSim(int iTest){
*/
int sqlite3IsNaN(double x){
int rc; /* The value return */
-#if !defined(SQLITE_HAVE_ISNAN)
+#if !SQLITE_HAVE_ISNAN && !HAVE_ISNAN
/*
** Systems that support the isnan() library function should probably
** make use of it by compiling with -DSQLITE_HAVE_ISNAN. But we have
@@ -88,9 +88,9 @@ int sqlite3IsNaN(double x){
volatile double y = x;
volatile double z = y;
rc = (y!=z);
-#else /* if defined(SQLITE_HAVE_ISNAN) */
+#else /* if HAVE_ISNAN */
rc = isnan(x);
-#endif /* SQLITE_HAVE_ISNAN */
+#endif /* HAVE_ISNAN */
testcase( rc );
return rc;
}
@@ -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++; }