mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-09 17:38:00 +00:00
wintime: add a precautionary memset to zero.
Coverity observes that sometimes 'struct tm' can have other fields (e.g. glibc's tm_gmtoff), so it's as well to make sure we initialise the whole thing to zero.
This commit is contained in:
parent
b6b52269e1
commit
2a2434e0cc
@ -10,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;
|
||||
|
Loading…
Reference in New Issue
Block a user