mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-12-22 17:34:54 +01:00
notmuch_parse_date: Handle a NULL date string gracefully.
The obvious thing to do is to treat a missing date as the beginning of time. Also, remove a useless cast from another return of 0.
This commit is contained in:
parent
8e4e0559e7
commit
401c6cc579
1 changed files with 5 additions and 2 deletions
5
date.c
5
date.c
|
@ -644,11 +644,14 @@ notmuch_parse_date (const char *str, int *tz_offset)
|
|||
date_token *token, *tokens;
|
||||
time_t date;
|
||||
|
||||
if (str == NULL)
|
||||
return 0;
|
||||
|
||||
if (!(tokens = datetok (str))) {
|
||||
if (tz_offset)
|
||||
*tz_offset = 0;
|
||||
|
||||
return (time_t) 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!(date = parse_rfc822_date (tokens, tz_offset)))
|
||||
|
|
Loading…
Reference in a new issue