Skip to content
Snippets Groups Projects
Commit 371e1584 authored by Rye Mutt's avatar Rye Mutt :bread:
Browse files

Fix two small bugs in LLFileSystem::write

parent 185ff36e
No related branches found
No related tags found
No related merge requests found
...@@ -172,7 +172,12 @@ BOOL LLFileSystem::write(const U8* buffer, S32 bytes) ...@@ -172,7 +172,12 @@ BOOL LLFileSystem::write(const U8* buffer, S32 bytes)
LLUniqueFile filep = LLFile::fopen(mFilePath, TEXT("ab")); LLUniqueFile filep = LLFile::fopen(mFilePath, TEXT("ab"));
if (filep) if (filep)
{ {
fwrite((const void*)buffer, bytes, 1, filep); fseek(filep, 0L, SEEK_END);
long fsize = ftell(filep);
fwrite((const void*)buffer, 1, bytes, filep);
mPosition = fsize + bytes;
success = TRUE; success = TRUE;
} }
...@@ -182,9 +187,9 @@ BOOL LLFileSystem::write(const U8* buffer, S32 bytes) ...@@ -182,9 +187,9 @@ BOOL LLFileSystem::write(const U8* buffer, S32 bytes)
LLUniqueFile filep = LLFile::fopen(mFilePath, TEXT("wb")); LLUniqueFile filep = LLFile::fopen(mFilePath, TEXT("wb"));
if (filep) if (filep)
{ {
fwrite((const void*)buffer, bytes, 1, filep); fwrite((const void*)buffer, 1, bytes, filep);
mPosition += bytes; mPosition = bytes;
success = TRUE; success = TRUE;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment