[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[MiNT] MiNTLib 0.51, mktime bug



Hi,

I'm sorry, I have to announce another bug in the MiNTLib:

If you manually assemble a struct tm and feed it into mktime() you may get
into trouble, e. g.:

	...
	memset (&tm, 0, sizeof tm);
	tm.tm_year = 99;
	tm.tm_mon = 5;
	tm.tm_day = 13;
	secs = mktime (&tm);

In this case SECS will be -1 (error).  Temporary fix: Set tm.tm_isdst to
-1 before you call mktime unless you are sure that DST does not apply
(then set it to 0) or that it certainly applies (then set it to >0).
Using -1 is always sure however (uhm, well, hopefully).

Ciao

Guido
-- 
http://stud.uni-sb.de/~gufl0000
mailto:gufl0000@stud.uni-sb.de