summaryrefslogtreecommitdiffstats
path: root/src/OSSupport/File.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-08-28 15:53:36 +0200
committerMattes D <github@xoft.cz>2014-08-28 15:53:36 +0200
commit52a6b30f324728aee1c1b8e54b8b4ed9c4e9b60c (patch)
treec7d8ad9c38a32102bd46e0450d271ea1308828ce /src/OSSupport/File.cpp
parentCheckBasicStyle: Added checking for the "template" keyword. (diff)
parentFixed ItemCategory code example. (diff)
downloadcuberite-52a6b30f324728aee1c1b8e54b8b4ed9c4e9b60c.tar
cuberite-52a6b30f324728aee1c1b8e54b8b4ed9c4e9b60c.tar.gz
cuberite-52a6b30f324728aee1c1b8e54b8b4ed9c4e9b60c.tar.bz2
cuberite-52a6b30f324728aee1c1b8e54b8b4ed9c4e9b60c.tar.lz
cuberite-52a6b30f324728aee1c1b8e54b8b4ed9c4e9b60c.tar.xz
cuberite-52a6b30f324728aee1c1b8e54b8b4ed9c4e9b60c.tar.zst
cuberite-52a6b30f324728aee1c1b8e54b8b4ed9c4e9b60c.zip
Diffstat (limited to 'src/OSSupport/File.cpp')
-rw-r--r--src/OSSupport/File.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/OSSupport/File.cpp b/src/OSSupport/File.cpp
index ff6fb5898..2194c46ee 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,10 +256,10 @@ 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');
+ a_Contents.assign(DataSize, '\0');
return Read((void *)a_Contents.data(), DataSize);
}
@@ -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());
}