Fix TimeToStringExact with mininmal int64 input

This commit is contained in:
Benoît Legat
2025-05-06 17:34:36 +02:00
parent a03c7580b9
commit 4f424dfea0

View File

@@ -246,7 +246,11 @@ const char* TimeToStringExact( int64_t _ns )
bufsel = ( bufsel + 1 ) % Pool;
uint64_t ns;
if( _ns < 0 )
if( _ns == std::numeric_limits<int64_t>::min() )
{
ns = -(_ns + 1) + 1;
}
else if( _ns < 0 )
{
*buf = '-';
buf++;