libc_ffat: zero-init 'struct tm' on stack
This prevents the following runtime error. Error: mktime() returned -1, the file modification time reported by stat() will be incorrect
This commit is contained in:
parent
e9b42a127b
commit
c79155fd7b
|
@ -718,6 +718,8 @@ class Plugin : public Libc::Plugin
|
|||
/* TODO: handle more attributes */
|
||||
|
||||
struct tm tm;
|
||||
::memset(&tm, 0, sizeof(tm));
|
||||
|
||||
tm.tm_year = ((file_info.fdate & 0b1111111000000000) >> 9) + 80;
|
||||
tm.tm_mon = (file_info.fdate & 0b0000000111100000) >> 5;
|
||||
tm.tm_mday = (file_info.fdate & 0b0000000000011111);
|
||||
|
|
Loading…
Reference in New Issue