From b5c858aa7560a0306c51bfccb2f76e2f1bf6c9e2 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Sun, 30 Oct 2016 20:19:03 +0100 Subject: [PATCH] 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.) --- src/system/libroot/posix/time/strptime.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/system/libroot/posix/time/strptime.c b/src/system/libroot/posix/time/strptime.c index a5a7904910..9e5a96e6f8 100644 --- a/src/system/libroot/posix/time/strptime.c +++ b/src/system/libroot/posix/time/strptime.c @@ -447,8 +447,6 @@ label: i -= 1900; if (c == 'y' && i < 69) i += 100; - if (i < 0) - return 0; tm->tm_year = i;