[OpenBIOS] r752 - ofw/fs

svn at openbios.org svn at openbios.org
Fri Dec 7 10:03:56 CET 2007


Author: wmb
Date: 2007-12-07 10:03:55 +0100 (Fri, 07 Dec 2007)
New Revision: 752

Modified:
   ofw/fs/unixtime.fth
Log:
OLPC trac 5391 - Don't crash if >unix-seconds is presented with an invalid month.



Modified: ofw/fs/unixtime.fth
===================================================================
--- ofw/fs/unixtime.fth	2007-12-05 23:12:36 UTC (rev 751)
+++ ofw/fs/unixtime.fth	2007-12-07 09:03:55 UTC (rev 752)
@@ -31,7 +31,8 @@
 : >unix-seconds   ( s m h d m y -- seconds )	\ since 1970
    d# 1970 - 4 /mod [ d# 365 4 * 1+ ] literal *		( s m h d m yrs days )
    swap d# 365 * +					( s m h d m days )
-   swap 1- 0 ?do  i days/month + c@ + loop		( s m h d days )
+   swap  1 max  d# 12 min				( s m h d days m' )
+   1- 0 ?do  i days/month + c@ + loop			( s m h d days )
    + 1-							( s m h days )
    d# 24 * +   d# 60 * +   d# 60 * +
 ;




More information about the OpenBIOS mailing list