diff --git a/UI/window-basic-main-scene-collections.cpp b/UI/window-basic-main-scene-collections.cpp index 9de9c84ca..126d0b19b 100644 --- a/UI/window-basic-main-scene-collections.cpp +++ b/UI/window-basic-main-scene-collections.cpp @@ -92,7 +92,6 @@ static bool SceneCollectionExists(const char *findName) static bool GetUnusedSceneCollectionFile(std::string &name, std::string &file) { char path[512]; - size_t len; int ret; if (!GetFileSafeName(name.c_str(), file)) { @@ -107,7 +106,6 @@ static bool GetUnusedSceneCollectionFile(std::string &name, std::string &file) return false; } - len = file.size(); file.insert(0, path); if (!GetClosestUnusedFileName(file, "json")) { @@ -117,7 +115,7 @@ static bool GetUnusedSceneCollectionFile(std::string &name, std::string &file) } file.erase(file.size() - 5, 5); - file.erase(0, file.size() - len); + file.erase(0, strlen(path)); return true; }