Author: gschneider
Date: Sat Aug 8 13:40:48 2009
New Revision: 42506
URL:
http://svn.reactos.org/svn/reactos?rev=42506&view=rev
Log:
-time() returns a valid value even if no pointer is passed
-Exposes another bug: kernel32's GetSystemTimeAsFileTime currently returns invalid
(too low) time values
Modified:
trunk/reactos/lib/sdk/crt/time/time.c
Modified: trunk/reactos/lib/sdk/crt/time/time.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/time/time.c?re…
==============================================================================
--- trunk/reactos/lib/sdk/crt/time/time.c [iso-8859-1] (original)
+++ trunk/reactos/lib/sdk/crt/time/time.c [iso-8859-1] Sat Aug 8 13:40:48 2009
@@ -11,14 +11,15 @@
time_t _time(time_t* ptime)
{
- FILETIME SystemTime;
- time_t time = 0;
+ FILETIME SystemTime;
+ time_t time = 0;
+
+ GetSystemTimeAsFileTime(&SystemTime);
+ time = FileTimeToUnixTime(&SystemTime, NULL);
if (ptime)
{
- GetSystemTimeAsFileTime(&SystemTime);
- time = FileTimeToUnixTime(&SystemTime, NULL);
- *ptime = time;
+ *ptime = time;
}
- return time;
+ return time;
}