Skip to content

Commit

Permalink
Remove a needless temporary buffer from runtime_log_get_runtime_str()
Browse files Browse the repository at this point in the history
  • Loading branch information
zoltanvb committed Aug 12, 2023
1 parent 0c64a07 commit 1f5d1c0
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions runtime_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -509,15 +509,11 @@ void runtime_log_get_runtime_str(runtime_log_t *runtime_log,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_PLAYLIST_SUBLABEL_RUNTIME),
len);
s[_len ] = ' ';
s[_len+1] = '\0';
if (runtime_log)
{
char t[64];
t[0] = '\0';
snprintf(t, sizeof(t), "%02u:%02u:%02u",
snprintf(s + _len + 1, len - _len - 1, "%02u:%02u:%02u",
runtime_log->runtime.hours, runtime_log->runtime.minutes,
runtime_log->runtime.seconds);
strlcpy(s + _len + 1, t, len - _len - 1);
}
else
{
Expand Down

0 comments on commit 1f5d1c0

Please sign in to comment.