strftime前对struct tm初始化

This commit is contained in:
zhangchengwei
2018-11-14 15:06:02 +08:00
committed by zhengchao
parent cc049d7f7c
commit f83f3a48f9
3 changed files with 4 additions and 3 deletions

View File

@@ -232,6 +232,7 @@ time_t expires_hdr2timestamp(const char *expires_val, int len)
return 0;
}
memset(&tm, 0, sizeof(struct tm));
if(strptime(expires_val, "%a, %d %b %Y %T", &tm) == NULL)
{
return 0;