Ensure entire struct is zeroed in _alpm_parsedate()

Signed-off-by: Dan McGee <dan@archlinux.org>
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
This commit is contained in:
Dan McGee 2011-09-18 16:55:23 -05:00
parent c12fa4ab19
commit 52c65fdfea
1 changed files with 2 additions and 1 deletions

View File

@ -1101,7 +1101,8 @@ time_t _alpm_parsedate(const char *line)
{
if(isalpha((unsigned char)line[0])) {
/* initialize to null in case of failure */
struct tm tmp_tm = { 0 };
struct tm tmp_tm;
memset(&tmp_tm, 0, sizeof(struct tm));
setlocale(LC_TIME, "C");
strptime(line, "%a %b %e %H:%M:%S %Y", &tmp_tm);
setlocale(LC_TIME, "");