diff --git a/libretro-common/dynamic/dylib.c b/libretro-common/dynamic/dylib.c index fa65d0ba6a..4b9e2bb36c 100644 --- a/libretro-common/dynamic/dylib.c +++ b/libretro-common/dynamic/dylib.c @@ -150,21 +150,19 @@ function_t dylib_proc(dylib_t lib, const char *proc) #ifdef _WIN32 HMODULE mod = (HMODULE)lib; -#ifndef __WINRT__ - if (!mod) - mod = GetModuleHandle(NULL); -#else - /* GetModuleHandle is not available on UWP */ if (!mod) { +#ifdef __WINRT__ + /* GetModuleHandle is not available on UWP */ /* It's not possible to lookup symbols in current executable * on UWP. */ DebugBreak(); return NULL; - } +#else + mod = GetModuleHandle(NULL); #endif - sym = (function_t)GetProcAddress(mod, proc); - if (!sym) + } + if (!(sym = (function_t)GetProcAddress(mod, proc))) { set_dl_error(); return NULL; diff --git a/libretro-common/lists/dir_list.c b/libretro-common/lists/dir_list.c index 22cbb02cd1..06264ec3d7 100644 --- a/libretro-common/lists/dir_list.c +++ b/libretro-common/lists/dir_list.c @@ -139,7 +139,6 @@ static int dir_list_read(const char *dir, continue; } - file_path[0] = '\0'; fill_pathname_join(file_path, dir, name, sizeof(file_path)); if (retro_dirent_is_dir(entry, NULL)) @@ -273,8 +272,8 @@ bool dir_list_initialize(struct string_list *list, bool include_hidden, bool include_compressed, bool recursive) { - if (!list || !string_list_initialize(list)) - return false; - return dir_list_append(list, dir, ext, include_dirs, + if (list && string_list_initialize(list)) + return dir_list_append(list, dir, ext, include_dirs, include_hidden, include_compressed, recursive); + return false; } diff --git a/libretro-common/playlists/label_sanitization.c b/libretro-common/playlists/label_sanitization.c index 43595175b3..745ee5c4b2 100644 --- a/libretro-common/playlists/label_sanitization.c +++ b/libretro-common/playlists/label_sanitization.c @@ -77,9 +77,8 @@ void label_sanitize(char *label, bool (*left)(char*), bool (*right)(char*)) { /* check for the start of the range */ if ((*left)(&label[lindex])) - copy = false; - - if (copy) + copy = false; + else new_label[rindex++] = label[lindex]; } else if ((*right)(&label[lindex])) diff --git a/libretro-common/vfs/vfs_implementation.c b/libretro-common/vfs/vfs_implementation.c index dae2cce580..be828db3c6 100644 --- a/libretro-common/vfs/vfs_implementation.c +++ b/libretro-common/vfs/vfs_implementation.c @@ -798,7 +798,7 @@ int retro_vfs_stat_impl(const char *path, int32_t *size) tmp = strdup(path); len = strlen(tmp); if (tmp[len-1] == '/') - tmp[len-1] = '\0'; + tmp[len-1] = '\0'; dir_ret = sceIoGetstat(tmp, &buf); free(tmp); @@ -1160,7 +1160,6 @@ bool retro_vfs_dirent_is_dir_impl(libretro_vfs_implementation_dir *rdir) return false; #endif /* dirent struct doesn't have d_type, do it the slow way ... */ - path[0] = '\0'; fill_pathname_join(path, rdir->orig_path, retro_vfs_dirent_get_name_impl(rdir), sizeof(path)); if (stat(path, &buf) < 0) return false;