Skip to content

Commit de2dff5

Browse files
committed
Common: corrects the position for appending milliseconds
1 parent b05c544 commit de2dff5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/common/time.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ static inline const char* ffTimeToTimeStr(uint64_t msec)
9292
time_t tsec = (time_t) (msec / 1000);
9393

9494
extern char ffTimeInternalBuffer[64];
95-
strftime(ffTimeInternalBuffer, ARRAY_SIZE(ffTimeInternalBuffer), "%T", localtime(&tsec));
96-
sprintf(ffTimeInternalBuffer + __builtin_strlen("00:00:00"), ".%03u", (unsigned) (msec % 1000));
95+
uint32_t len = (uint32_t) strftime(ffTimeInternalBuffer, ARRAY_SIZE(ffTimeInternalBuffer), "%T", localtime(&tsec));
96+
sprintf(ffTimeInternalBuffer + len, ".%03u", (unsigned) (msec % 1000));
9797
return ffTimeInternalBuffer;
9898
}
9999

0 commit comments

Comments
 (0)