mirror of
https://github.com/libretro/RetroArch
synced 2025-03-18 04:21:19 +00:00
Replace some usage of strcpy and strcat
This commit is contained in:
parent
90008242eb
commit
831e33739e
@ -420,9 +420,11 @@ int generic_menu_entry_action(
|
|||||||
char title_name[255];
|
char title_name[255];
|
||||||
char speak_string[512];
|
char speak_string[512];
|
||||||
|
|
||||||
strcpy(title_name, "");
|
strlcpy(title_name, "", sizeof(title_name));
|
||||||
strcpy(current_label, "");
|
strlcpy(current_label, "", sizeof(current_label));
|
||||||
|
|
||||||
get_current_menu_value(current_value);
|
get_current_menu_value(current_value);
|
||||||
|
|
||||||
switch (action)
|
switch (action)
|
||||||
{
|
{
|
||||||
case MENU_ACTION_INFO:
|
case MENU_ACTION_INFO:
|
||||||
@ -444,28 +446,25 @@ int generic_menu_entry_action(
|
|||||||
get_current_menu_label(current_label);
|
get_current_menu_label(current_label);
|
||||||
case MENU_ACTION_SCAN:
|
case MENU_ACTION_SCAN:
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* TODO/FIXME - replace strcmp with string_is_equal */
|
||||||
|
strlcpy(speak_string, "", sizeof(speak_string));
|
||||||
|
if (strcmp(title_name, "") != 0)
|
||||||
{
|
{
|
||||||
strcpy(speak_string, "");
|
strlcpy(speak_string, title_name, sizeof(speak_string));
|
||||||
if (strcmp(title_name, "") != 0)
|
strlcat(speak_string, " ", sizeof(speak_string));
|
||||||
{
|
|
||||||
strcpy(speak_string, title_name);
|
|
||||||
strcat(speak_string, " ");
|
|
||||||
}
|
|
||||||
strcat(speak_string, current_label);
|
|
||||||
if (strcmp(current_value, "...")!=0)
|
|
||||||
{
|
|
||||||
strcat(speak_string, " ");
|
|
||||||
strcat(speak_string, current_value);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (strcmp(speak_string, "") != 0)
|
|
||||||
{
|
|
||||||
accessibility_speak(speak_string);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
strlcat(speak_string, current_label, sizeof(speak_string));
|
||||||
|
if (strcmp(current_value, "...")!=0)
|
||||||
|
{
|
||||||
|
strlcat(speak_string, " ", sizeof(speak_string));
|
||||||
|
strlcat(speak_string, current_value, sizeof(speak_string));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (strcmp(speak_string, "") != 0)
|
||||||
|
accessibility_speak(speak_string);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -4140,6 +4140,7 @@ void get_current_menu_value(char* retstr)
|
|||||||
menu_entry_get(&entry, 0, menu_navigation_get_selection(), NULL, true);
|
menu_entry_get(&entry, 0, menu_navigation_get_selection(), NULL, true);
|
||||||
menu_entry_get_value(&entry, &entry_label);
|
menu_entry_get_value(&entry, &entry_label);
|
||||||
|
|
||||||
|
/* TODO/FIXME - replace strcpy with strlcpy */
|
||||||
strcpy(retstr, entry_label);
|
strcpy(retstr, entry_label);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4153,6 +4154,7 @@ void get_current_menu_label(char* retstr)
|
|||||||
menu_entry_get(&entry, 0, menu_navigation_get_selection(), NULL, true);
|
menu_entry_get(&entry, 0, menu_navigation_get_selection(), NULL, true);
|
||||||
menu_entry_get_rich_label(&entry, &entry_label);
|
menu_entry_get_rich_label(&entry, &entry_label);
|
||||||
|
|
||||||
|
/* TODO/FIXME - replace strcpy with strlcpy */
|
||||||
strcpy(retstr, entry_label);
|
strcpy(retstr, entry_label);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4166,5 +4168,7 @@ void get_current_menu_sublabel(char* retstr)
|
|||||||
menu_entry_get(&entry, 0, menu_navigation_get_selection(), NULL, true);
|
menu_entry_get(&entry, 0, menu_navigation_get_selection(), NULL, true);
|
||||||
|
|
||||||
menu_entry_get_sublabel(&entry, &entry_sublabel);
|
menu_entry_get_sublabel(&entry, &entry_sublabel);
|
||||||
|
|
||||||
|
/* TODO/FIXME - replace strcpy with strlcpy */
|
||||||
strcpy(retstr, entry_sublabel);
|
strcpy(retstr, entry_sublabel);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user