From 68de1b571f108f45509a069d0887c21adf853c83 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 20 Nov 2015 13:58:19 +0100 Subject: [PATCH] Check if global is non-NULL instead --- menu/cbs/menu_cbs_left.c | 5 ++--- menu/cbs/menu_cbs_right.c | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/menu/cbs/menu_cbs_left.c b/menu/cbs/menu_cbs_left.c index eee9bfddcf..dbf8a7e533 100644 --- a/menu/cbs/menu_cbs_left.c +++ b/menu/cbs/menu_cbs_left.c @@ -304,12 +304,11 @@ static int playlist_association_left(unsigned type, const char *label, { int i, next, found, current = 0; char core_path[PATH_MAX_LENGTH] = {0}; + char new_playlist_cores[PATH_MAX_LENGTH] = {0}; global_t *global = global_get_ptr(); settings_t *settings = config_get_ptr(); const char *path = path_basename(label); - char new_playlist_cores[PATH_MAX_LENGTH] = {0}; - - core_info_list_t *list = (global->core_info.list) ? global->core_info.list : NULL; + core_info_list_t *list = global ? global->core_info.list : NULL; if (!list) return -1; diff --git a/menu/cbs/menu_cbs_right.c b/menu/cbs/menu_cbs_right.c index ef4b87db7a..0cbcb53023 100644 --- a/menu/cbs/menu_cbs_right.c +++ b/menu/cbs/menu_cbs_right.c @@ -329,12 +329,11 @@ static int playlist_association_right(unsigned type, const char *label, { int i, next, found, current = 0; char core_path[PATH_MAX_LENGTH] = {0}; + char new_playlist_cores[PATH_MAX_LENGTH] = {0}; global_t *global = global_get_ptr(); settings_t *settings = config_get_ptr(); const char *path = path_basename(label); - char new_playlist_cores[PATH_MAX_LENGTH] = {0}; - - core_info_list_t *list = (global->core_info.list) ? global->core_info.list : NULL; + core_info_list_t *list = global ? global->core_info.list : NULL; if (!list) return -1;