From 6e06f1418025fb7024bd9ccd908dd83bc005df2a Mon Sep 17 00:00:00 2001 From: libretroadmin Date: Sun, 16 Jul 2023 22:21:43 +0200 Subject: [PATCH] Cut some more strlcat calls --- runtime_file.c | 4 ++-- verbosity.c | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/runtime_file.c b/runtime_file.c index f2832c0edb4..20646a7d1fc 100644 --- a/runtime_file.c +++ b/runtime_file.c @@ -781,7 +781,7 @@ void runtime_log_get_last_played_str(runtime_log_t *runtime_log, strftime_am_pm(tmp, sizeof(tmp), format_str, &time_info); str[ _len] = ' '; str[++_len] = '\0'; - strlcat(str, tmp, len); + strlcpy(str + _len, tmp, len - _len); return; } @@ -1040,7 +1040,7 @@ void runtime_log_get_last_played_str(runtime_log_t *runtime_log, sizeof(tmp)); str[ _len] = ' '; str[++_len] = '\0'; - strlcat(str, tmp, len); + strlcpy(str + _len, tmp, len - _len); return; case PLAYLIST_LAST_PLAYED_STYLE_YMD_HMS: default: diff --git a/verbosity.c b/verbosity.c index 69fdae26665..8171be343f8 100644 --- a/verbosity.c +++ b/verbosity.c @@ -462,9 +462,7 @@ void rarch_log_file_init( time_t cur_time = time(NULL); rtime_localtime(&cur_time, &tm_); - strftime(timestamped_log_file_name, sizeof(timestamped_log_file_name), "retroarch__%Y_%m_%d__%H_%M_%S", &tm_); - strlcat(timestamped_log_file_name, ".log", - sizeof(timestamped_log_file_name)); + strftime(timestamped_log_file_name, sizeof(timestamped_log_file_name), "retroarch__%Y_%m_%d__%H_%M_%S.log", &tm_); } /* If nothing has changed, do nothing */