Common: corrects the position for appending milliseconds

This commit is contained in:
Carter Li
2025-08-20 11:07:53 +08:00
parent b05c54486f
commit de2dff5da0
+2 -2
View File
@@ -92,8 +92,8 @@ static inline const char* ffTimeToTimeStr(uint64_t msec)
time_t tsec = (time_t) (msec / 1000);
extern char ffTimeInternalBuffer[64];
strftime(ffTimeInternalBuffer, ARRAY_SIZE(ffTimeInternalBuffer), "%T", localtime(&tsec));
sprintf(ffTimeInternalBuffer + __builtin_strlen("00:00:00"), ".%03u", (unsigned) (msec % 1000));
uint32_t len = (uint32_t) strftime(ffTimeInternalBuffer, ARRAY_SIZE(ffTimeInternalBuffer), "%T", localtime(&tsec));
sprintf(ffTimeInternalBuffer + len, ".%03u", (unsigned) (msec % 1000));
return ffTimeInternalBuffer;
}