Merge pull request #2956 from RytoEX/fix-GetUnusedSceneCollectionFile

UI: Fix GetUnusedSceneCollectionFile filename creation
This commit is contained in:
Jim 2020-06-21 06:33:26 -07:00 committed by GitHub
commit b6375a2a68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;
}