From de2dff5da04af43a66b71491833e73edfa115897 Mon Sep 17 00:00:00 2001 From: Carter Li Date: Wed, 20 Aug 2025 11:07:53 +0800 Subject: [PATCH] Common: corrects the position for appending milliseconds --- src/common/time.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/time.h b/src/common/time.h index 149fb2843..7390f1819 100644 --- a/src/common/time.h +++ b/src/common/time.h @@ -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; }