mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-14 06:18:34 +00:00
Fix more dereference before NULL checks
This commit is contained in:
parent
fa7a792180
commit
770640be58
@ -117,16 +117,17 @@ static int action_left_input_desc(unsigned type, const char *label,
|
||||
static int action_left_input_desc_kbd(unsigned type, const char *label,
|
||||
bool wraparound)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
unsigned key_id;
|
||||
unsigned offset = type - MENU_SETTINGS_INPUT_DESC_KBD_BEGIN;
|
||||
unsigned remap_id =
|
||||
settings->uints.input_keymapper_ids[offset];
|
||||
char desc[PATH_MAX_LENGTH];
|
||||
unsigned key_id;
|
||||
unsigned remap_id;
|
||||
unsigned offset = type - MENU_SETTINGS_INPUT_DESC_KBD_BEGIN;
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
if (!settings)
|
||||
return 0;
|
||||
|
||||
remap_id = settings->uints.input_keymapper_ids[offset];
|
||||
|
||||
for (key_id = 0; key_id < MENU_SETTINGS_INPUT_DESC_KBD_END - MENU_SETTINGS_INPUT_DESC_KBD_BEGIN; key_id++)
|
||||
{
|
||||
if(remap_id == key_descriptors[key_id].key)
|
||||
|
@ -107,15 +107,16 @@ int action_right_input_desc_kbd(unsigned type, const char *label,
|
||||
bool wraparound)
|
||||
{
|
||||
unsigned key_id;
|
||||
unsigned remap_id;
|
||||
char desc[PATH_MAX_LENGTH];
|
||||
unsigned offset = type - MENU_SETTINGS_INPUT_DESC_KBD_BEGIN;
|
||||
settings_t *settings = config_get_ptr();
|
||||
unsigned remap_id =
|
||||
settings->uints.input_keymapper_ids[offset];
|
||||
|
||||
if (!settings)
|
||||
return 0;
|
||||
|
||||
remap_id = settings->uints.input_keymapper_ids[offset];
|
||||
|
||||
for (key_id = 0; key_id < MENU_SETTINGS_INPUT_DESC_KBD_END - MENU_SETTINGS_INPUT_DESC_KBD_BEGIN; key_id++)
|
||||
{
|
||||
if(remap_id == key_descriptors[key_id].key)
|
||||
|
Loading…
Reference in New Issue
Block a user