[fpc-devel] MSecsToTimeStamp patch

petr.kristan at epos.cz petr.kristan at epos.cz
Wed Mar 26 16:31:25 CET 2008


Aritmetic Owerflow, for example MSecsToTimeStamp(63250588800000) //1.5.2005
Repaired bad typecasting.

Index: objpas/sysutils/dati.inc
===================================================================
--- objpas/sysutils/dati.inc    (revision 10368)
+++ objpas/sysutils/dati.inc    (working copy)
@@ -75,7 +75,7 @@
 function MSecsToTimeStamp(MSecs: comp): TTimeStamp;
 begin
   result.Date := Trunc(msecs / msecsperday);
-  msecs:= comp(msecs-result.date*msecsperday);
+  msecs:= msecs-comp(result.date)*msecsperday;
   result.Time := Round(MSecs);
 end ;

-- 
Ing. Petr Kristan
.
EPOS PRO s.r.o., Bozeny Nemcove 2625, 530 02 Pardubice
tel: +420 466335223    Czech Republic (Eastern Europe) 
fax: +420 466510709



More information about the fpc-devel mailing list