mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-30 20:58:54 +00:00
Completely fixed DSPTool, on all of its memory leaks, bad API and bad C++. (compiling with include works perfectly)
More small leftover fixes git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3071 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
72febe7b8a
commit
1045fc7e98
14 changed files with 153 additions and 138 deletions
|
@ -620,7 +620,7 @@ bool WriteStringToFile(bool text_file, const std::string &str, const char *filen
|
|||
return true;
|
||||
}
|
||||
|
||||
bool ReadFileToString(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)
|
||||
|
@ -630,7 +630,7 @@ bool ReadFileToString(bool text_file, const char *filename, std::string *str)
|
|||
fseek(f, 0, SEEK_SET);
|
||||
char *buf = new char[len + 1];
|
||||
buf[fread(buf, 1, len, f)] = 0;
|
||||
*str = std::string(buf, len);
|
||||
str = std::string(buf, len);
|
||||
fclose(f);
|
||||
delete [] buf;
|
||||
return true;
|
||||
|
|
|
@ -100,7 +100,7 @@ std::string GetBundleDirectory();
|
|||
#endif
|
||||
|
||||
bool WriteStringToFile(bool text_file, const std::string &str, const char *filename);
|
||||
bool ReadFileToString(bool text_file, const char *filename, std::string *str);
|
||||
bool ReadFileToString(bool text_file, const char *filename, std::string &str);
|
||||
|
||||
} // namespace
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue