summaryrefslogtreecommitdiffstats
path: root/src/core/FileMgr.cpp
diff options
context:
space:
mode:
authorerorcun <erayorcunus@gmail.com>2020-10-08 15:15:55 +0200
committerGitHub <noreply@github.com>2020-10-08 15:15:55 +0200
commitbf98dcbc3a19bd80fefe0c4cd2a1cb975e678242 (patch)
tree1f5e271c7f3447686fb8b9e5715e9fba14bc19c2 /src/core/FileMgr.cpp
parentlittle renamings & librw update (diff)
parentFix some sanitizer errors, improve POSIX streamer (diff)
downloadre3-bf98dcbc3a19bd80fefe0c4cd2a1cb975e678242.tar
re3-bf98dcbc3a19bd80fefe0c4cd2a1cb975e678242.tar.gz
re3-bf98dcbc3a19bd80fefe0c4cd2a1cb975e678242.tar.bz2
re3-bf98dcbc3a19bd80fefe0c4cd2a1cb975e678242.tar.lz
re3-bf98dcbc3a19bd80fefe0c4cd2a1cb975e678242.tar.xz
re3-bf98dcbc3a19bd80fefe0c4cd2a1cb975e678242.tar.zst
re3-bf98dcbc3a19bd80fefe0c4cd2a1cb975e678242.zip
Diffstat (limited to 'src/core/FileMgr.cpp')
-rw-r--r--src/core/FileMgr.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/core/FileMgr.cpp b/src/core/FileMgr.cpp
index ac51f8de..6e6a8efc 100644
--- a/src/core/FileMgr.cpp
+++ b/src/core/FileMgr.cpp
@@ -142,17 +142,17 @@ static size_t
myfread(void *buf, size_t elt, size_t n, int fd)
{
if(myfiles[fd].isText){
- char *p;
+ unsigned char *p;
size_t i;
int c;
n *= elt;
- p = (char*)buf;
+ p = (unsigned char*)buf;
for(i = 0; i < n; i++){
c = myfgetc(fd);
if(c == EOF)
break;
- *p++ = c;
+ *p++ = (unsigned char)c;
}
return i / elt;
}
@@ -163,12 +163,12 @@ static size_t
myfwrite(void *buf, size_t elt, size_t n, int fd)
{
if(myfiles[fd].isText){
- char *p;
+ unsigned char *p;
size_t i;
int c;
n *= elt;
- p = (char*)buf;
+ p = (unsigned char*)buf;
for(i = 0; i < n; i++){
c = *p++;
myfputc(c, fd);