From d35a163b3db29641b54e4524e6618cc62f16afd9 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sun, 6 Jul 2008 21:17:58 +0000 Subject: (__mktime_internal): Normalize tp->tm_isdst value. --- time/mktime.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'time') diff --git a/time/mktime.c b/time/mktime.c index e299375a16..e47d69615a 100644 --- a/time/mktime.c +++ b/time/mktime.c @@ -1,5 +1,5 @@ /* Convert a `struct tm' to a time_t value. - Copyright (C) 1993-1999, 2002-2006, 2007 Free Software Foundation, Inc. + Copyright (C) 1993-1999, 2002-2007, 2008 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Paul Eggert . @@ -293,7 +293,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; -- cgit 1.4.1