strptime: allow dates before 1900.

While struct tm makes things more confusing than they need to be,
nothing in the API prevents handling those. So let's just accept them.

Fixes some strange cases in the cookie test suite (with a cookie set to
expire in year 101 B.C.)
This commit is contained in:
Adrien Destugues
2016-10-30 20:23:43 +01:00
parent 2215451b39
commit b5c858aa75
-2
View File
@@ -447,8 +447,6 @@ label:
i -= 1900;
if (c == 'y' && i < 69)
i += 100;
if (i < 0)
return 0;
tm->tm_year = i;