summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
Diffstat (limited to 'win32')
-rw-r--r--win32/win32.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/win32/win32.c b/win32/win32.c
index fc1cd29b2d..b570a4295d 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -5758,6 +5758,9 @@ unixtime_to_filetime(time_t time, FILETIME *ft)
FILETIME lt;
tm = localtime(&time);
+ if (!tm) {
+ return -1;
+ }
st.wYear = tm->tm_year + 1900;
st.wMonth = tm->tm_mon + 1;
st.wDayOfWeek = tm->tm_wday;