Reduce local string sizes

This commit is contained in:
libretroadmin 2024-12-25 22:36:13 +01:00
parent 9c71620c53
commit 1450cc04de
2 changed files with 12 additions and 18 deletions

View File

@ -5148,7 +5148,6 @@ static unsigned menu_displaylist_parse_content_information(
&& !string_is_empty(db_name))
{
char db_path[PATH_MAX_LENGTH];
fill_pathname_join_special(db_path,
settings->paths.path_content_database,
db_name,
@ -6688,7 +6687,7 @@ static unsigned menu_displaylist_populate_subsystem(
{
_len2 += strlcpy(rom_buff + _len2,
path_basename(content_get_subsystem_rom(j)),
sizeof(rom_buff) - _len2);
sizeof(rom_buff) - _len2);
if (j != content_get_subsystem_rom_id() - 1)
_len2 += strlcpy(rom_buff + _len2, "|", sizeof(rom_buff) - _len2);
}
@ -12835,7 +12834,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
{
size_t _len;
unsigned i;
char text[PATH_MAX_LENGTH];
char text[128];
const size_t profiles_count = sizeof(SWITCH_CPU_PROFILES)/sizeof(SWITCH_CPU_PROFILES[1]);
/* TODO/FIXME - localize */
runloop_msg_queue_push("Warning : extended overclocking can damage the Switch",
@ -15188,7 +15187,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
menu_entries_clear(info->list);
#if defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_SLANG) || defined(HAVE_HLSL)
{
char new_exts[PATH_MAX_LENGTH];
char new_exts[128];
gfx_ctx_flags_t flags;
size_t _len = 0;
new_exts[0] = '\0';
@ -15251,7 +15250,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
#if defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_SLANG) || defined(HAVE_HLSL)
{
gfx_ctx_flags_t flags;
char new_exts[PATH_MAX_LENGTH];
char new_exts[128];
size_t _len = 0;
flags.flags = 0;
@ -15291,7 +15290,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
info->type_default = FILE_TYPE_IMAGE;
{
size_t _len = 0;
char new_exts[PATH_MAX_LENGTH];
char new_exts[128];
new_exts[0] = '\0';
#ifdef HAVE_RBMP
_len += strlcpy(new_exts + _len, "bmp", sizeof(new_exts) - _len);

View File

@ -460,7 +460,6 @@ void rarch_log_file_init(
static char timestamped_log_file_name[64] = {0};
bool logging_to_file = g_verbosity->initialized;
/* If this is the first run, generate a timestamped log
* file name (do this even when not outputting timestamped
* log files, since user may decide to switch at any moment...) */
@ -538,18 +537,14 @@ void rarch_log_file_init(
if (!string_is_empty(log_file_path))
{
/* Create log directory, if required */
if (!string_is_empty(log_directory))
if ( !string_is_empty(log_directory)
&& !path_is_directory(log_directory)
&& !path_mkdir(log_directory))
{
if (!path_is_directory(log_directory))
{
if (!path_mkdir(log_directory))
{
/* Re-enable console logging and output error message */
retro_main_log_file_init(NULL, false);
RARCH_ERR("Failed to create system event log directory: %s\n", log_directory);
return;
}
}
/* Re-enable console logging and output error message */
retro_main_log_file_init(NULL, false);
RARCH_ERR("Failed to create system event log directory: %s\n", log_directory);
return;
}
/* When RetroArch is launched, log file is overwritten.