mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-31 21:28:51 +00:00
Second attempt at issue 3458. Fixes issue 3458.
Replaces all occurrences of ftell and fseek with ftello and fseeko, respectively. This matters on non-win32 where only these names are altered by the _FILE_OFFSET_BITS define. Win32 still just maps the funcs to ftelli64/fseeki64. Also add some File::GetSize I had skipped in my last commit. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6515 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
97e3a3ea6f
commit
e70e623624
18 changed files with 54 additions and 60 deletions
|
@ -106,9 +106,9 @@ bool ReadFileToString(bool text_file, const char *filename, std::string &str)
|
|||
FILE *f = fopen(filename, text_file ? "r" : "rb");
|
||||
if (!f)
|
||||
return false;
|
||||
fseek(f, 0, SEEK_END);
|
||||
size_t len = ftell(f);
|
||||
fseek(f, 0, SEEK_SET);
|
||||
fseeko(f, 0, SEEK_END);
|
||||
size_t len = ftello(f);
|
||||
fseeko(f, 0, SEEK_SET);
|
||||
char *buf = new char[len + 1];
|
||||
buf[fread(buf, 1, len, f)] = 0;
|
||||
str = std::string(buf, len);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue