diff options
author | erorcun <erorcunerorcun@hotmail.com.tr> | 2020-12-21 21:26:32 +0100 |
---|---|---|
committer | erorcun <erorcunerorcun@hotmail.com.tr> | 2020-12-25 10:54:41 +0100 |
commit | a50244dc16085a49f4949cf75f6220320480cebd (patch) | |
tree | 34a022c699eed9c8651ddbe8391c985753e46b2b /src/core/FileMgr.cpp | |
parent | Merge branch 'miami' of github.com:GTAmodding/re3 into miami (diff) | |
download | re3-a50244dc16085a49f4949cf75f6220320480cebd.tar re3-a50244dc16085a49f4949cf75f6220320480cebd.tar.gz re3-a50244dc16085a49f4949cf75f6220320480cebd.tar.bz2 re3-a50244dc16085a49f4949cf75f6220320480cebd.tar.lz re3-a50244dc16085a49f4949cf75f6220320480cebd.tar.xz re3-a50244dc16085a49f4949cf75f6220320480cebd.tar.zst re3-a50244dc16085a49f4949cf75f6220320480cebd.zip |
Diffstat (limited to 'src/core/FileMgr.cpp')
-rw-r--r-- | src/core/FileMgr.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/core/FileMgr.cpp b/src/core/FileMgr.cpp index d3695cb4..99923ddf 100644 --- a/src/core/FileMgr.cpp +++ b/src/core/FileMgr.cpp @@ -240,20 +240,22 @@ CFileMgr::SetDirMyDocuments(void) mychdir(_psGetUserFilesFolder()); } -size_t +ssize_t CFileMgr::LoadFile(const char *file, uint8 *buf, int unused, const char *mode) { int fd; - size_t n, len; + ssize_t n, len; fd = myfopen(file, mode); if(fd == 0) - return 0; + return -1; len = 0; do{ n = myfread(buf + len, 1, 0x4000, fd); - if(n < 0) +#ifndef FIX_BUGS + if (n < 0) return -1; +#endif len += n; }while(n == 0x4000); buf[len] = 0; @@ -274,13 +276,13 @@ CFileMgr::OpenFileForWriting(const char *file) } size_t -CFileMgr::Read(int fd, const char *buf, size_t len) +CFileMgr::Read(int fd, const char *buf, ssize_t len) { return myfread((void*)buf, 1, len, fd); } size_t -CFileMgr::Write(int fd, const char *buf, size_t len) +CFileMgr::Write(int fd, const char *buf, ssize_t len) { return myfwrite((void*)buf, 1, len, fd); } |