Skip to content

Commit

Permalink
Cut some more strlcat calls
Browse files Browse the repository at this point in the history
  • Loading branch information
LibretroAdmin committed Jul 16, 2023
1 parent 07f2227 commit 6e06f14
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions runtime_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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:
Expand Down
4 changes: 1 addition & 3 deletions verbosity.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 6e06f14

Please sign in to comment.