mirror of
https://github.com/curl/curl.git
synced 2026-07-28 15:03:06 +03:00
parsedate: allow time specified without seconds
The date format in RFC822 allows that the seconds part of HH:MM:SS is left out, but this function didn't allow it. This change also includes a modified test case that makes sure that this now works. Reported by: Matt Ford Bug: http://curl.haxx.se/bug/view.cgi?id=3076529
This commit is contained in:
parent
33c3bb057b
commit
4d58f97f60
3 changed files with 9 additions and 0 deletions
|
|
@ -371,6 +371,12 @@ int Curl_parsedate(const char *date, time_t *output)
|
|||
/* time stamp! */
|
||||
date += 8;
|
||||
}
|
||||
else if((secnum == -1) &&
|
||||
(2 == sscanf(date, "%02d:%02d", &hournum, &minnum))) {
|
||||
/* time stamp without seconds */
|
||||
date += 5;
|
||||
secnum = 0;
|
||||
}
|
||||
else {
|
||||
val = (int)strtol(date, &end, 10);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue