diff --git a/frontend/frontend_salamander.c b/frontend/frontend_salamander.c index 7a34499e95..280e193271 100644 --- a/frontend/frontend_salamander.c +++ b/frontend/frontend_salamander.c @@ -44,7 +44,7 @@ static void find_first_libretro_core(char *first_file, const char * ext) { size_t i; - bool ret = false; + bool ret = false; struct string_list *list = dir_list_new(dir, ext, false, true, false, false); if (!list) @@ -59,9 +59,9 @@ static void find_first_libretro_core(char *first_file, for (i = 0; i < list->size && !ret; i++) { - char fname[PATH_MAX_LENGTH]; - char salamander_name[PATH_MAX_LENGTH]; - const char *libretro_elem = (const char*)list->elems[i].data; + char fname[PATH_MAX_LENGTH] = {0}; + char salamander_name[PATH_MAX_LENGTH] = {0}; + const char *libretro_elem = (const char*)list->elems[i].data; RARCH_LOG("Checking library: \"%s\".\n", libretro_elem); @@ -94,12 +94,12 @@ static void find_first_libretro_core(char *first_file, dir_list_free(list); } +/* Last fallback - we'll need to start the first executable file + * we can find in the RetroArch cores directory. + */ static void find_and_set_first_file(char *s, size_t len, const char *ext) { - /* Last fallback - we'll need to start the first executable file - * we can find in the RetroArch cores directory. - */ char first_file[PATH_MAX_LENGTH] = {0}; find_first_libretro_core(first_file, sizeof(first_file), @@ -122,8 +122,9 @@ static void salamander_init(char *s, size_t len) if (config_exists) { - char tmp_str[PATH_MAX_LENGTH]; - config_file_t * conf = (config_file_t*)config_file_new(g_defaults.path.config); + char tmp_str[PATH_MAX_LENGTH] = {0}; + config_file_t * conf = (config_file_t*) + config_file_new(g_defaults.path.config); if (conf) { @@ -145,7 +146,7 @@ static void salamander_init(char *s, size_t len) if (!config_exists || string_is_equal(s, "")) { - char executable_name[PATH_MAX_LENGTH]; + char executable_name[PATH_MAX_LENGTH] = {0}; frontend_driver_get_core_extension( executable_name, sizeof(executable_name)); @@ -169,12 +170,10 @@ static void salamander_init(char *s, size_t len) int main(int argc, char *argv[]) { - char libretro_path[PATH_MAX_LENGTH]; - void *args = NULL; - struct rarch_main_wrap *wrap_args = NULL; - frontend_ctx_driver_t *frontend_ctx = NULL; - - frontend_ctx = (frontend_ctx_driver_t*)frontend_ctx_init_first(); + char libretro_path[PATH_MAX_LENGTH] = {0}; + void *args = NULL; + struct rarch_main_wrap *wrap_args = NULL; + frontend_ctx_driver_t *frontend_ctx = (frontend_ctx_driver_t*)frontend_ctx_init_first(); if (!frontend_ctx) return 0;