diff --git a/cocos/platform/CCFileUtils.cpp b/cocos/platform/CCFileUtils.cpp index e4cecfe52175..8c817b544014 100644 --- a/cocos/platform/CCFileUtils.cpp +++ b/cocos/platform/CCFileUtils.cpp @@ -897,7 +897,7 @@ std::string FileUtils::fullPathForDirectory(const std::string &dir) const { for (const auto& resolutionIt : _searchResolutionsOrderArray) { - fullpath.append(searchIt).append(longdir).append(resolutionIt); + fullpath.assign(searchIt).append(longdir).append(resolutionIt); auto exists = isDirectoryExistInternal(fullpath); if (exists && !fullpath.empty())