diff options
| author | Mark A. Hershberger <mah@debian.(none)> | 2009-03-25 00:37:27 -0400 |
|---|---|---|
| committer | Mark A. Hershberger <mah@debian.(none)> | 2009-03-25 00:37:27 -0400 |
| commit | 2d4e5b09576bb4f0ba716cc82cdf29ea04d9184b (patch) | |
| tree | 41ccc042009cba53e4ce43e727fcba4c1cfbf7f3 /ext/sqlite/libsqlite | |
| parent | d29a4fd2dd3b5d4cf6e80b602544d7b71d794e76 (diff) | |
| download | php-2d4e5b09576bb4f0ba716cc82cdf29ea04d9184b.tar.gz | |
Imported Upstream version 5.2.2upstream/5.2.2
Diffstat (limited to 'ext/sqlite/libsqlite')
| -rw-r--r-- | ext/sqlite/libsqlite/src/date.c | 9 | ||||
| -rw-r--r-- | ext/sqlite/libsqlite/src/encode.c | 7 |
2 files changed, 11 insertions, 5 deletions
diff --git a/ext/sqlite/libsqlite/src/date.c b/ext/sqlite/libsqlite/src/date.c index 233aa7bb3..d1d7ddb5f 100644 --- a/ext/sqlite/libsqlite/src/date.c +++ b/ext/sqlite/libsqlite/src/date.c @@ -16,7 +16,7 @@ ** sqliteRegisterDateTimeFunctions() found at the bottom of the file. ** All other code has file scope. ** -** $Id: date.c,v 1.3.4.1 2005/09/07 15:11:32 iliaa Exp $ +** $Id: date.c,v 1.3.4.1.2.2 2006/12/01 20:24:58 fmk Exp $ ** ** NOTES: ** @@ -53,6 +53,9 @@ #include <stdlib.h> #include <assert.h> #include <time.h> +#ifndef PHP_WIN32 +#include "main/php_reentrancy.h" +#endif #ifndef SQLITE_OMIT_DATETIME_FUNCS @@ -397,7 +400,7 @@ static void clearYMD_HMS_TZ(DateTime *p){ static double localtimeOffset(DateTime *p){ DateTime x, y; time_t t; - struct tm *pTm; + struct tm *pTm, tmbuf; x = *p; computeYMD_HMS(&x); if( x.Y<1971 || x.Y>=2038 ){ @@ -416,7 +419,7 @@ static double localtimeOffset(DateTime *p){ computeJD(&x); t = (x.rJD-2440587.5)*86400.0 + 0.5; sqliteOsEnterMutex(); - pTm = localtime(&t); + pTm = php_localtime_r(&t, &tmbuf); y.Y = pTm->tm_year + 1900; y.M = pTm->tm_mon + 1; y.D = pTm->tm_mday; diff --git a/ext/sqlite/libsqlite/src/encode.c b/ext/sqlite/libsqlite/src/encode.c index 86e33a750..956d7d128 100644 --- a/ext/sqlite/libsqlite/src/encode.c +++ b/ext/sqlite/libsqlite/src/encode.c @@ -15,7 +15,7 @@ ** data in an SQLite database. The code in this file is not used by any other ** part of the SQLite library. ** -** $Id: encode.c,v 1.5.4.1 2005/09/07 15:11:32 iliaa Exp $ +** $Id: encode.c,v 1.5.4.1.2.1 2006/12/24 20:50:02 iliaa Exp $ */ #include <string.h> #include <assert.h> @@ -176,9 +176,12 @@ int sqlite_decode_binary(const unsigned char *in, unsigned char *out){ int i, e; unsigned char c; e = *(in++); + if (e == 0) { + return 0; + } i = 0; while( (c = *(in++))!=0 ){ - if( c==1 ){ + if (c == 1) { c = *(in++) - 1; } out[i++] = c + e; |
