summaryrefslogtreecommitdiff
path: root/plugins/Db3x_mmap/src/database.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Db3x_mmap/src/database.cpp')
-rw-r--r--plugins/Db3x_mmap/src/database.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/Db3x_mmap/src/database.cpp b/plugins/Db3x_mmap/src/database.cpp
index 723ddea5a7..47b12b2c70 100644
--- a/plugins/Db3x_mmap/src/database.cpp
+++ b/plugins/Db3x_mmap/src/database.cpp
@@ -32,6 +32,8 @@ DWORD CDb3Mmap::CreateNewSpace(int bytes)
{
DWORD ofsNew = m_dbHeader.ofsFileEnd;
m_dbHeader.ofsFileEnd += bytes;
+ if (m_dbHeader.ofsFileEnd > m_dwFileSize)
+ ReMap(m_dbHeader.ofsFileEnd - m_dwFileSize);
DBWrite(0, &m_dbHeader, sizeof(m_dbHeader));
log2("newspace %d@%08x", bytes, ofsNew);
return ofsNew;
@@ -65,7 +67,7 @@ DWORD CDb3Mmap::ReallocSpace(DWORD ofs, int oldSize, int newSize)
}
else {
ofsNew = CreateNewSpace(newSize);
- DBMoveChunk(ofsNew,ofs,oldSize);
+ DBMoveChunk(ofsNew, ofs, oldSize);
DeleteSpace(ofs,oldSize);
}
return ofsNew;