summaryrefslogtreecommitdiffstats
path: root/src/OSSupport/File.cpp
diff options
context:
space:
mode:
authorTycho <work.tycho+git@gmail.com>2014-08-10 20:34:11 +0200
committerTycho <work.tycho+git@gmail.com>2014-08-10 20:34:11 +0200
commit806d0936dc94f235858ffe1772a6215f86c5d000 (patch)
tree38a84d8de02dc7da20af969f88c722abbea13300 /src/OSSupport/File.cpp
parentMerge pull request #1291 from mc-server/RedstoneCleanUp (diff)
downloadcuberite-806d0936dc94f235858ffe1772a6215f86c5d000.tar
cuberite-806d0936dc94f235858ffe1772a6215f86c5d000.tar.gz
cuberite-806d0936dc94f235858ffe1772a6215f86c5d000.tar.bz2
cuberite-806d0936dc94f235858ffe1772a6215f86c5d000.tar.lz
cuberite-806d0936dc94f235858ffe1772a6215f86c5d000.tar.xz
cuberite-806d0936dc94f235858ffe1772a6215f86c5d000.tar.zst
cuberite-806d0936dc94f235858ffe1772a6215f86c5d000.zip
Diffstat (limited to 'src/OSSupport/File.cpp')
-rw-r--r--src/OSSupport/File.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/OSSupport/File.cpp b/src/OSSupport/File.cpp
index ff6fb5898..af8a832f6 100644
--- a/src/OSSupport/File.cpp
+++ b/src/OSSupport/File.cpp
@@ -70,6 +70,7 @@ bool cFile::Open(const AString & iFileName, eMode iMode)
case fmRead: Mode = "rb"; break;
case fmWrite: Mode = "wb"; break;
case fmReadWrite: Mode = "rb+"; break;
+ case fmAppend: Mode = "a+"; break;
}
if (Mode == NULL)
{
@@ -255,7 +256,7 @@ int cFile::ReadRestOfFile(AString & a_Contents)
return -1;
}
- int DataSize = GetSize() - Tell();
+ size_t DataSize = GetSize() - Tell();
// HACK: This depends on the internal knowledge that AString's data() function returns the internal buffer directly
a_Contents.assign((size_t)DataSize, '\0');
@@ -459,7 +460,7 @@ int cFile::Printf(const char * a_Fmt, ...)
va_start(args, a_Fmt);
AppendVPrintf(buf, a_Fmt, args);
va_end(args);
- return Write(buf.c_str(), (int)buf.length());
+ return Write(buf.c_str(), buf.length());
}