From: Gustavo André dos Santos Lopes Date: Fri, 12 Nov 2010 18:37:02 +0000 (+0000) Subject: - Fixed bug #53297 (gettimeofday implementation in php/win32/time.c can return X-Git-Tag: php-5.4.0alpha1~191^2~689 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ae5704272e64af1f55afc60d7a5a4a7a0296da5e;p=php - 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. --- 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; }