summaryrefslogtreecommitdiff
path: root/src/core/FileMgr.cpp
diff options
context:
space:
mode:
authoreray orçunus <erayorcunus@gmail.com>2020-10-04 22:39:54 +0300
committereray orçunus <erayorcunus@gmail.com>2020-10-04 22:39:54 +0300
commit8c170a62ee5960bcb752630807101efd67d76e00 (patch)
tree1f8d60c06806a7dc8a5d398ac4282bf32f9b075f /src/core/FileMgr.cpp
parentea4007a13c844007b5b5ad06b6e01941cbd66e10 (diff)
Fix some sanitizer errors, improve POSIX streamer
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);