From f6474b98a85877aae2b7c0c8485e280bbf68053a Mon Sep 17 00:00:00 2001 From: hrydgard Date: Sun, 12 Apr 2009 13:12:42 +0000 Subject: DSP assembler: Error message improvements. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2956 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Common/Src/FileUtil.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Source/Core/Common/Src/FileUtil.cpp') diff --git a/Source/Core/Common/Src/FileUtil.cpp b/Source/Core/Common/Src/FileUtil.cpp index 05030deb59..8a16ae01dd 100644 --- a/Source/Core/Common/Src/FileUtil.cpp +++ b/Source/Core/Common/Src/FileUtil.cpp @@ -601,13 +601,13 @@ const char *GetUserDirectory() return path; } -bool WriteStringToFile(bool text_file, const char *str, const char *filename) +bool WriteStringToFile(bool text_file, const std::string &str, const char *filename) { FILE *f = fopen(filename, text_file ? "w" : "wb"); if (!f) return false; - size_t len = strlen(str); - if (len != fwrite(str, 1, strlen(str), f)) + size_t len = str.size(); + if (len != fwrite(str.data(), 1, str.size(), f)) { fclose(f); return false; @@ -616,7 +616,7 @@ bool WriteStringToFile(bool text_file, const char *str, const char *filename) return true; } -bool ReadStringFromFile(bool text_file, const char *filename, std::string *str) +bool ReadFileToString(bool text_file, const char *filename, std::string *str) { FILE *f = fopen(filename, text_file ? "r" : "rb"); if (!f) -- cgit v1.2.3