From f84662a39d84292891896bf3d0e156eabef56c30 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 2 Feb 2015 18:14:49 +0100 Subject: [PATCH] menu_entries_content_list_push - cleanups --- menu/menu_entries.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/menu/menu_entries.c b/menu/menu_entries.c index dcf0edd1fc..cd507c4aa0 100644 --- a/menu/menu_entries.c +++ b/menu/menu_entries.c @@ -126,7 +126,7 @@ int menu_entries_push_list(menu_handle_t *menu, static void menu_entries_content_list_push( file_list_t *list, core_info_t *info, const char* path) { - int num_items = 0, j; + unsigned j; struct string_list *str_list = NULL; if (!info) @@ -135,12 +135,12 @@ static void menu_entries_content_list_push( str_list = (struct string_list*)dir_list_new(path, info->supported_extensions, true); + if (!str_list) + return; + dir_list_sort(str_list, true); - if (str_list) - num_items = str_list->size; - - for (j = 0; j < num_items; j++) + for (j = 0; j < str_list->size; j++) { if (str_list->elems[j].attr.i == RARCH_DIRECTORY) menu_entries_content_list_push(list, info,