Silence some code analysis warnings

This commit is contained in:
libretroadmin 2025-07-18 10:06:16 +02:00
parent cd0f159238
commit cc408864af
3 changed files with 10 additions and 10 deletions

View File

@ -946,8 +946,9 @@ void rcheevos_validate_config_settings(void)
const char* val = core_option_manager_get_val(coreopts, i);
if (!rc_libretro_is_setting_allowed(disallowed_settings, key, val))
{
size_t _len;
char buffer[128];
size_t _len = snprintf(buffer, sizeof(buffer),
snprintf(buffer, sizeof(buffer),
msg_hash_to_str_us(MSG_CHEEVOS_HARDCORE_PAUSED_SETTING_NOT_ALLOWED), key, val);
CHEEVOS_LOG(RCHEEVOS_TAG "%s\n", buffer);
_len = snprintf(buffer, sizeof(buffer),
@ -1270,7 +1271,7 @@ static void rcheevos_show_game_placard(void)
{
char badge_name[32];
size_t __len = strlcpy(badge_name, "i", sizeof(badge_name));
__len += strlcpy(badge_name + __len, game->badge_name,
strlcpy(badge_name + __len, game->badge_name,
sizeof(badge_name) - __len);
gfx_widgets_push_achievement(game->title, msg, badge_name);
}

View File

@ -114,7 +114,6 @@ static void Discord_RegisterW(
if (FAILED(result))
fprintf(stderr, "Error writing description\n");
len = (DWORD)lstrlenW(protocolDescription) + 1;
result = RegSetKeyValueW(key, NULL, L"URL Protocol", REG_SZ, &urlProtocol, sizeof(wchar_t));
if (FAILED(result))
fprintf(stderr, "Error writing description\n");
@ -142,7 +141,7 @@ void Discord_Register(const char* applicationId, const char* command)
if (command && command[0])
{
const int commandBufferLen =
const int commandBufferLen =
sizeof(openCommand) / sizeof(*openCommand);
MultiByteToWideChar(CP_UTF8, 0, command, -1,
openCommand, commandBufferLen);

View File

@ -1741,7 +1741,7 @@ static unsigned menu_displaylist_parse_supported_cores(
_len += strlcpy(entry_alt_text + _len,
pending_core_name,
sizeof(entry_alt_text) - _len);
_len += strlcpy(entry_alt_text + _len, ")", sizeof(entry_alt_text) - _len);
strlcpy(entry_alt_text + _len, ")", sizeof(entry_alt_text) - _len);
menu_entries_prepend(info->list, pending_core_path,
msg_hash_to_str(current_core_enum_label),
@ -6854,7 +6854,7 @@ static unsigned menu_displaylist_populate_subsystem(
_len += strlcpy(s + _len,
subsystem->roms[content_get_subsystem_rom_id()].desc,
sizeof(s) - _len);
_len += strlcpy(s + _len, "]", sizeof(s) - _len);
strlcpy(s + _len, "]", sizeof(s) - _len);
}
#endif
@ -15441,7 +15441,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
{
if (_len > 0)
_len += strlcpy(new_exts + _len, "|", sizeof(new_exts) - _len);
_len += strlcpy(new_exts + _len, "slang", sizeof(new_exts) - _len);
strlcpy(new_exts + _len, "slang", sizeof(new_exts) - _len);
}
}
break;
@ -15485,7 +15485,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
{
if (_len > 0)
_len += strlcpy(new_exts + _len, "|", sizeof(new_exts) - _len);
_len += strlcpy(new_exts + _len, "slangp", sizeof(new_exts) - _len);
strlcpy(new_exts + _len, "slangp", sizeof(new_exts) - _len);
}
if (!string_is_empty(info->exts))
free(info->exts);
@ -15523,7 +15523,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
#ifdef HAVE_RTGA
if (_len > 0)
_len += strlcpy(new_exts + _len, "|", sizeof(new_exts) - _len);
_len += strlcpy(new_exts + _len, "tga", sizeof(new_exts) - _len);
strlcpy(new_exts + _len, "tga", sizeof(new_exts) - _len);
#endif
if (!string_is_empty(info->exts))
free(info->exts);
@ -15679,7 +15679,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type,
if (_len > 0)
{
_len += strlcpy(ext_names + _len, "|", sizeof(ext_names) - _len);
_len += strlcpy(ext_names + _len, FILE_PATH_CORE_BACKUP_EXTENSION_NO_DOT, sizeof(ext_names) - _len);
strlcpy(ext_names + _len, FILE_PATH_CORE_BACKUP_EXTENSION_NO_DOT, sizeof(ext_names) - _len);
}
else
strlcpy(ext_names, FILE_PATH_CORE_BACKUP_EXTENSION_NO_DOT, sizeof(ext_names));