From 0c64a07cdba9b001a3d39404a9748ed285864452 Mon Sep 17 00:00:00 2001 From: zoltanvb <101990835+zoltanvb@users.noreply.github.com> Date: Fri, 11 Aug 2023 23:16:50 +0200 Subject: [PATCH] Fix runtime display. (#15581) Due to an error in 631301b3f7d58d0969c1ebdaf2bb3907be5d0025, 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. --- runtime_file.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/runtime_file.c b/runtime_file.c index 20646a7d1f..352c8abfd6 100644 --- a/runtime_file.c +++ b/runtime_file.c @@ -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 {