From a2cb3f60a4f831666e4d6171f2957dcbdef4445e Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 27 Apr 2019 02:17:17 +0200 Subject: [PATCH] path_get_extension - fix regression --- libretro-common/file/file_path.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libretro-common/file/file_path.c b/libretro-common/file/file_path.c index eb5d7181a3..ce6ca8920e 100644 --- a/libretro-common/file/file_path.c +++ b/libretro-common/file/file_path.c @@ -286,8 +286,9 @@ const char *path_get_archive_delim(const char *path) */ const char *path_get_extension(const char *path) { - if (!string_is_empty(path)) - return strrchr(path_basename(path), '.') + 1; + const char *ext; + if (!string_is_empty(path) && ((ext = strrchr(path_basename(path), '.')))) + return ext + 1; return ""; }