Skip to content

Commit

Permalink
Fix runtime display. (#15581)
Browse files Browse the repository at this point in the history
Due to an error in 631301b, the
runtime display string was working well only when the label had
a length of 7. Even the English "Runtime:" was a bit truncated
as a space was supposed to be added after the :, but it was
even more noticeable in other languages.
  • Loading branch information
zoltanvb authored Aug 11, 2023
1 parent 6733d6d commit 0c64a07
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions runtime_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -512,13 +512,12 @@ void runtime_log_get_runtime_str(runtime_log_t *runtime_log,
s[_len+1] = '\0';
if (runtime_log)
{
size_t _len2;
char t[64];
t[0] = '\0';
_len2 = snprintf(t, sizeof(t), "%02u:%02u:%02u",
snprintf(t, sizeof(t), "%02u:%02u:%02u",
runtime_log->runtime.hours, runtime_log->runtime.minutes,
runtime_log->runtime.seconds);
strlcpy(s + _len2, t, len - _len2);
strlcpy(s + _len + 1, t, len - _len - 1);
}
else
{
Expand Down

0 comments on commit 0c64a07

Please sign in to comment.