Cut some more strlcat calls

This commit is contained in:
libretroadmin 2023-07-16 22:21:43 +02:00
parent 07f22270f7
commit 6e06f14180
2 changed files with 3 additions and 5 deletions

View File

@ -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:

View File

@ -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 */