We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b46985a commit 9823d3fCopy full SHA for 9823d3f
1 file changed
src/lib/mzip.c
@@ -13,7 +13,6 @@
13
#include <stdio.h>
14
#include <string.h>
15
#include <fcntl.h>
16
-#include <string.h>
17
#include <time.h>
18
#include <sys/stat.h>
19
#include <unistd.h>
@@ -115,7 +114,7 @@ static void mzip_get_dostime(uint16_t *dos_time, uint16_t *dos_date) {
115
114
if (now != (time_t)-1 && mzip_localtime_r(&now, &tm_buf) != NULL) {
116
tm_ptr = &tm_buf;
117
}
118
- if (!tm_ptr) {
+ if (!tm_ptr && now != (time_t)-1) {
119
struct tm *tmp = localtime(&now);
120
if (tmp) {
121
/* copy into stack buffer to have a consistent pointer */
0 commit comments