diff --git a/nmap-update/nmap-update.c b/nmap-update/nmap-update.c index 07f0cb3c1..2e2a0844e 100644 --- a/nmap-update/nmap-update.c +++ b/nmap-update/nmap-update.c @@ -591,9 +591,13 @@ static int parse_date(const char *s, time_t *t) { struct tm tm = {0}; - if (strptime(s, "%Y-%d-%m", &tm) == NULL) + if (sscanf(s, "%d-%d-%d", &tm.tm_year, &tm.tm_mon, &tm.tm_mday) != 3) return -1; + tm.tm_year -= 1900; + tm.tm_mon -= 1; *t = mktime(&tm); + if (*t == -1) + return -1; return 0; }