]> asedeno.scripts.mit.edu Git - PuTTY.git/blobdiff - windows/wintime.c
first pass
[PuTTY.git] / windows / wintime.c
index eea0cf622e81eb293e2ed7be89c1df61b3b0d5c6..5fa3b0ded19e4f6d571b74c2d28169e653ad3061 100644 (file)
@@ -1,3 +1,7 @@
+/*
+ * wintime.c - Avoid trouble with time() returning (time_t)-1 on Windows.
+ */
+
 #include "putty.h"
 #include <time.h>
 
@@ -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;