From 44276b824a74503bcbfbb9abb838ba51e77d2845 Mon Sep 17 00:00:00 2001 From: halx99 Date: Sun, 14 Jun 2020 16:29:40 +0800 Subject: [PATCH] Merge: 58403292cd bfd1709ab7 Merge pull request #108 from halx99/master Optimzie writeStringToFile --- cocos/platform/CCFileUtils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/platform/CCFileUtils.cpp b/cocos/platform/CCFileUtils.cpp index 98236dff79..1fdbb21d97 100644 --- a/cocos/platform/CCFileUtils.cpp +++ b/cocos/platform/CCFileUtils.cpp @@ -479,7 +479,7 @@ FileUtils::~FileUtils() bool FileUtils::writeStringToFile(const std::string& dataStr, const std::string& fullPath) const { - return FileUtils::writeBinaryToFile(dataStr.c_str(), dataStr.length(), fullPath); + return FileUtils::writeBinaryToFile(dataStr.c_str(), dataStr.size(), fullPath); } void FileUtils::writeStringToFile(std::string dataStr, const std::string& fullPath, std::function callback) const