aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/misc.c2
-rw-r--r--protocols/oscar/oscar.c1
2 files changed, 3 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);
}
diff --git a/protocols/oscar/oscar.c b/protocols/oscar/oscar.c
index c96e342e..30ad4b68 100644
--- a/protocols/oscar/oscar.c
+++ b/protocols/oscar/oscar.c
@@ -2272,6 +2272,7 @@ static int gaim_icqinfo(aim_session_t *sess, aim_frame_t *fr, ...)
if (info->birthyear || info->birthmonth || info->birthday) {
char date[30];
struct tm tm;
+ memset(&tm, 0, sizeof(struct tm));
tm.tm_mday = (int)info->birthday;
tm.tm_mon = (int)info->birthmonth-1;
tm.tm_year = (int)info->birthyear%100;