mirror of
https://github.com/libretro/RetroArch
synced 2025-04-16 08:43:10 +00:00
Make string_list code more robust
This commit is contained in:
parent
c7c1526529
commit
bb5d2877cf
@ -28,7 +28,7 @@ static INLINE void get_title(const char *label, const char *dir,
|
|||||||
struct string_list *list_label = string_split(label, "|");
|
struct string_list *list_label = string_split(label, "|");
|
||||||
struct string_list *list_path = string_split(dir, "|");
|
struct string_list *list_path = string_split(dir, "|");
|
||||||
|
|
||||||
if (list_label)
|
if (list_label && list_label->size > 0)
|
||||||
{
|
{
|
||||||
strlcpy(elem0_label, list_label->elems[0].data, sizeof(elem0_label));
|
strlcpy(elem0_label, list_label->elems[0].data, sizeof(elem0_label));
|
||||||
if (list_label->size > 1)
|
if (list_label->size > 1)
|
||||||
@ -36,7 +36,7 @@ static INLINE void get_title(const char *label, const char *dir,
|
|||||||
string_list_free(list_label);
|
string_list_free(list_label);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (list_path)
|
if (list_path && list_path->size > 0)
|
||||||
{
|
{
|
||||||
strlcpy(elem0_path, list_path->elems[0].data, sizeof(elem0_path));
|
strlcpy(elem0_path, list_path->elems[0].data, sizeof(elem0_path));
|
||||||
if (list_path->size > 1)
|
if (list_path->size > 1)
|
||||||
|
@ -3813,7 +3813,7 @@ static int menu_entries_cbs_init_bind_ok_first(menu_file_list_cbs_t *cbs,
|
|||||||
menu_list_get_last_stack(driver.menu->menu_list,
|
menu_list_get_last_stack(driver.menu->menu_list,
|
||||||
NULL, &menu_label, NULL);
|
NULL, &menu_label, NULL);
|
||||||
|
|
||||||
if (str_list)
|
if (str_list && str_list->size > 0)
|
||||||
{
|
{
|
||||||
strlcpy(elem0, str_list->elems[0].data, sizeof(elem0));
|
strlcpy(elem0, str_list->elems[0].data, sizeof(elem0));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user