Skip to content

Commit 9823d3f

Browse files
committed
Unnecessary duplicate header included and catch time case
1 parent b46985a commit 9823d3f

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/lib/mzip.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#include <stdio.h>
1414
#include <string.h>
1515
#include <fcntl.h>
16-
#include <string.h>
1716
#include <time.h>
1817
#include <sys/stat.h>
1918
#include <unistd.h>
@@ -115,7 +114,7 @@ static void mzip_get_dostime(uint16_t *dos_time, uint16_t *dos_date) {
115114
if (now != (time_t)-1 && mzip_localtime_r(&now, &tm_buf) != NULL) {
116115
tm_ptr = &tm_buf;
117116
}
118-
if (!tm_ptr) {
117+
if (!tm_ptr && now != (time_t)-1) {
119118
struct tm *tmp = localtime(&now);
120119
if (tmp) {
121120
/* copy into stack buffer to have a consistent pointer */

0 commit comments

Comments
 (0)