php_localtime_r() checks

This commit is contained in:
Antony Dovgal 2007-06-07 09:07:12 +00:00
parent 976a22df16
commit f1f0deae4c
5 changed files with 21 additions and 6 deletions

View file

@ -418,6 +418,9 @@ static double localtimeOffset(DateTime *p){
t = (x.rJD-2440587.5)*86400.0 + 0.5;
sqliteOsEnterMutex();
pTm = php_localtime_r(&t, &tmbuf);
if (!pTm) {
return 0;
}
y.Y = pTm->tm_year + 1900;
y.M = pTm->tm_mon + 1;
y.D = pTm->tm_mday;