From 3332c5be0818dcb6bafca1d89f5dc07224e0d565 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Gustavo=20Andr=C3=A9=20dos=20Santos=20Lopes?= Date: Fri, 12 Nov 2010 18:37:02 +0000 Subject: [PATCH] - Fixed bug #53297 (gettimeofday implementation in php/win32/time.c can return 1 million microsecs). (ped at 7gods dot org) - Moved line out of order in NEWS. --- NEWS | 4 +++- win32/time.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 582aff8837..9a380614ce 100644 --- a/NEWS +++ b/NEWS @@ -60,7 +60,8 @@ - Fixed the filter extension accepting IPv4 octets with a leading 0 as that belongs to the unsupported "dotted octal" representation. (Gustavo) -- Fixed bug #52693 (configuration file errors are not logged to stderr). (fat) +- Fixed bug #53297 (gettimeofday implementation in php/win32/time.c can return + 1 million microsecs). (ped at 7gods dot org) - Fixed bug #53279 (SplFileObject doesn't initialise default CSV escape character). (Adam) - Fixed bug #53273 (mb_strcut() returns garbage with the excessive length @@ -130,6 +131,7 @@ CASE-WHEN). (Andrey) - Fixed bug #52699 (PDO bindValue writes long int 32bit enum). (rein at basefarm dot no) +- Fixed bug #52693 (configuration file errors are not logged to stderr). (fat) - Fixed bug #52686 (mysql_stmt_attr_[gs]et argument points to incorrect type). (rein at basefarm dot no) - Fixed bug #52681 (mb_send_mail() appends an extra MIME-Version header). diff --git a/win32/time.c b/win32/time.c index 808ce8d5bd..a376fd61be 100644 --- a/win32/time.c +++ b/win32/time.c @@ -105,7 +105,7 @@ PHPAPI int gettimeofday(struct timeval *time_Info, struct timezone *timezone_Inf dt = (double)timer/PW32G(freq); time_Info->tv_sec = PW32G(starttime).tv_sec + (int)dt; time_Info->tv_usec = PW32G(starttime).tv_usec + (int)((dt-(int)dt)*1000000); - if (time_Info->tv_usec > 1000000) { + if (time_Info->tv_usec >= 1000000) { time_Info->tv_usec -= 1000000; ++time_Info->tv_sec; } -- 2.40.0