mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-09 17:38:00 +00:00
06434ffc71
Fixes crashes when time() returns (time_t)-1 on Windows by using the Win32 GetLocalTime() function. (The Unix implementation still just uses time() and localtime().) [originally from svn r5086]
11 lines
152 B
C
11 lines
152 B
C
#include <time.h>
|
|
#include <assert.h>
|
|
|
|
struct tm ltime(void)
|
|
{
|
|
time_t t;
|
|
time(&t);
|
|
assert (t != ((time_t)-1));
|
|
return *localtime(&t);
|
|
}
|