X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=lib%2Fmktime.c;h=776a48af3dbd44dae70f9d0d6f302d6fbf15ce65;hb=785cdec4450a1459fdbb90df1344b69be34e0059;hp=045f7d2d5251735df3437401213b76666fbb842d;hpb=138fc7e67e3d9845cd7d81aad0e9c7724784f9b9;p=tar diff --git a/lib/mktime.c b/lib/mktime.c index 045f7d2..776a48a 100644 --- a/lib/mktime.c +++ b/lib/mktime.c @@ -292,7 +292,9 @@ __mktime_internal (struct tm *tp, int mday = tp->tm_mday; int mon = tp->tm_mon; int year_requested = tp->tm_year; - int isdst = tp->tm_isdst; + /* Normalize the value. */ + int isdst = ((tp->tm_isdst >> (8 * sizeof (tp->tm_isdst) - 1)) + | (tp->tm_isdst != 0)); /* 1 if the previous probe was DST. */ int dst2;