aboutsummaryrefslogtreecommitdiffstats
path: root/lib/misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/misc.c')
-rw-r--r--lib/misc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/misc.c b/lib/misc.c
index c2dd966e..18d98f9e 100644
--- a/lib/misc.c
+++ b/lib/misc.c
@@ -89,12 +89,14 @@ time_t get_time(int year, int month, int day, int hour, int min, int sec)
{
struct tm tm;
+ memset(&tm, 0, sizeof(struct tm));
tm.tm_year = year - 1900;
tm.tm_mon = month - 1;
tm.tm_mday = day;
tm.tm_hour = hour;
tm.tm_min = min;
tm.tm_sec = sec >= 0 ? sec : time(NULL) % 60;
+
return mktime(&tm);
}