From fae6543b7a2f3ed49026ad299fd20a8d163b45ae Mon Sep 17 00:00:00 2001 From: Martin Gerhardy Date: Sun, 13 Mar 2022 18:42:39 +0100 Subject: [PATCH] Fixed find_last_of call in GetBaseFilename this leads to a stack overflow on linux - it looks like this magically works on msvc though... --- tiny_gltf.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tiny_gltf.h b/tiny_gltf.h index 6188dc0..586f8da 100644 --- a/tiny_gltf.h +++ b/tiny_gltf.h @@ -2041,8 +2041,7 @@ static std::string GetBaseDir(const std::string &filepath) { } static std::string GetBaseFilename(const std::string &filepath) { - constexpr char path_separators[2] = { '/', '\\' }; - auto idx = filepath.find_last_of(path_separators); + auto idx = filepath.find_last_of("/\\"); if (idx != std::string::npos) return filepath.substr(idx + 1); return filepath;