Silence Linux snprintf warnings (#14131)

This commit is contained in:
sonninnos 2022-07-02 15:08:27 +03:00 committed by GitHub
parent df25f88432
commit ee8993c76a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 13 additions and 12 deletions

View File

@ -1443,7 +1443,7 @@ bool command_event_save_core_config(
if (path_is_valid(core_path))
{
unsigned i;
char tmp[PATH_MAX_LENGTH];
char tmp[PATH_MAX_LENGTH + 8];
RARCH_LOG("[Config]: %s\n", msg_hash_to_str(MSG_USING_CORE_NAME_FOR_NEW_CONFIG));
fill_pathname_base_noext(

View File

@ -3925,7 +3925,7 @@ bool config_load_override(void *data)
/* Create a new config file from content_path */
if (config_file_exists(content_path))
{
char temp_path[PATH_MAX_LENGTH];
char temp_path[PATH_MAX_LENGTH + 1];
RARCH_LOG("[Overrides]: Content dir-specific overrides found at \"%s\".\n",
content_path);
@ -3957,7 +3957,7 @@ bool config_load_override(void *data)
/* Create a new config file from game_path */
if (config_file_exists(game_path))
{
char temp_path[PATH_MAX_LENGTH];
char temp_path[PATH_MAX_LENGTH + 1];
RARCH_LOG("[Overrides]: Game-specific overrides found at \"%s\".\n",
game_path);

View File

@ -6392,9 +6392,9 @@ static void ozone_show_fullscreen_thumbnails(ozone_handle_t *ozone)
}
else if (string_to_unsigned(selected_entry.label) == MENU_ENUM_LABEL_STATE_SLOT)
{
snprintf(tmpstr, sizeof(tmpstr), "%s %s",
snprintf(tmpstr, sizeof(tmpstr), "%s %d",
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_STATE_SLOT),
selected_entry.path);
string_to_unsigned(selected_entry.path));
thumbnail_label = tmpstr;
}
/* > Quick Menu playlist label */

View File

@ -3975,9 +3975,9 @@ static void xmb_show_fullscreen_thumbnails(
}
else if (string_to_unsigned(selected_entry.label) == MENU_ENUM_LABEL_STATE_SLOT)
{
snprintf(tmpstr, sizeof(tmpstr), "%s %s",
snprintf(tmpstr, sizeof(tmpstr), "%s %d",
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_STATE_SLOT),
selected_entry.path);
string_to_unsigned(selected_entry.path));
thumbnail_label = tmpstr;
}
/* > Quick Menu playlist label */

View File

@ -130,7 +130,7 @@ static void contentless_cores_init_info_entries(
/* Populate licences string */
if (core_info->licenses_list)
{
char tmp_str[MENU_SUBLABEL_MAX_LENGTH];
char tmp_str[MENU_SUBLABEL_MAX_LENGTH - 2];
tmp_str[0] = '\0';

View File

@ -445,7 +445,7 @@ static void input_autoconfigure_connect_handler(retro_task_t *task)
autoconfig_handle_t *autoconfig_handle = NULL;
bool match_found = false;
const char *device_display_name = NULL;
char task_title[NAME_MAX_LENGTH];
char task_title[NAME_MAX_LENGTH + 16];
task_title[0] = '\0';
@ -782,7 +782,7 @@ static void cb_input_autoconfigure_disconnect(
static void input_autoconfigure_disconnect_handler(retro_task_t *task)
{
autoconfig_handle_t *autoconfig_handle = NULL;
char task_title[NAME_MAX_LENGTH];
char task_title[NAME_MAX_LENGTH + 16];
task_title[0] = '\0';

View File

@ -770,7 +770,8 @@ static int database_info_list_iterate_found_match(
if (!string_is_empty(db_state->serial))
{
snprintf(db_crc, str_len, "%s|serial", db_state->serial);
if (snprintf(db_crc, str_len, "%s|serial", db_state->serial) < 0)
RARCH_ERR("Serial string encoding error\n");
}
else
{

View File

@ -1830,7 +1830,7 @@ static bool dump_to_file_desperate(const void *data,
time_t time_;
struct tm tm_;
char timebuf[256];
char path[PATH_MAX_LENGTH];
char path[PATH_MAX_LENGTH + 256 + 32];
char application_data[PATH_MAX_LENGTH];
application_data[0] = '\0';