From d67a118ad48a7d461e32a200f1668a14b78c1fb1 Mon Sep 17 00:00:00 2001 From: LazyBumHorse Date: Sat, 8 Jun 2019 19:12:30 +0200 Subject: [PATCH] path_relative_to: fix return in void function --- libretro-common/file/file_path.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/libretro-common/file/file_path.c b/libretro-common/file/file_path.c index bd774eb474..30d7dd0bd9 100644 --- a/libretro-common/file/file_path.c +++ b/libretro-common/file/file_path.c @@ -781,10 +781,13 @@ void path_relative_to(char *out, const char *path, const char *base, size_t size #ifdef _WIN32 /* For different drives, return absolute path */ - if (strlen(path) > 2 && strlen(base) > 2) - if (path[1] == ':' && base[1] == ':') - if (path[0] != base[0]) - return path; + if (strlen(path) >= 2 && strlen(base) >= 2 + && path[1] == ':' && base[1] == ':' + && path[0] != base[0]) + { + out[0] = '\0'; + strlcat(out, path, size); + } #endif /* Trim common beginning */