FileDateToDateTime for values<0
My code called SUBJ with value<0 (it was get from FileAge() which got -1 for deleted file). In this case, value<0, we will get exception with creepy text: https://github.com/Alexey-T/CudaText/issues/3760 ``` Function FileDateToDateTime (Filedate : Longint) : TDateTime; {$ifndef unix} Var Date,Time : Word; begin Date:=FileDate shr 16; Time:=FileDate and $ffff; Result:=ComposeDateTime(EncodeDate((Date shr 9) + 1980,(Date shr 5) and 15, Date and 31), EncodeTime(Time shr 11, (Time shr 5) and 63, (Time and 31) shl 1,0)); end; {$else unix} var y, mon, d, h, min, s: word; begin EpochToLocal(FileDate,y,mon,d,h,min,s); Result:=ComposeDateTime(EncodeDate(y,mon,d),EncodeTime(h,min,s,0)); end; {$endif unix} ``` My suggestion is to check that SUBJ parameter is < 0 (or <= 0 ?) **at the function beginning**, and raise exception right there.
issue