X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=windows%2Fwintime.c;h=5fa3b0ded19e4f6d571b74c2d28169e653ad3061;hb=HEAD;hp=eea0cf622e81eb293e2ed7be89c1df61b3b0d5c6;hpb=06434ffc713ff60f7631b48e0b1463fcfc92684b;p=PuTTY.git diff --git a/windows/wintime.c b/windows/wintime.c index eea0cf62..5fa3b0de 100644 --- a/windows/wintime.c +++ b/windows/wintime.c @@ -1,3 +1,7 @@ +/* + * wintime.c - Avoid trouble with time() returning (time_t)-1 on Windows. + */ + #include "putty.h" #include @@ -6,6 +10,8 @@ struct tm ltime(void) SYSTEMTIME st; struct tm tm; + memset(&tm, 0, sizeof(tm)); /* in case there are any other fields */ + GetLocalTime(&st); tm.tm_sec=st.wSecond; tm.tm_min=st.wMinute;