summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-12-28 11:05:11 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-12-28 11:05:11 +0000
commit585beea01e6e45ea8ce1464dd92e768b46fb9b55 (patch)
tree8e2fbd28eb75a47f51d332b6bcd8434eac23d2b8
parentc8c307feec88c5a7b5d9fd81a785e7f5667083d2 (diff)
never, never modify a header before the successful write
git-svn-id: http://svn.miranda-ng.org/main/trunk@15948 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--plugins/Db3x_mmap/src/dbmodulechain.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/Db3x_mmap/src/dbmodulechain.cpp b/plugins/Db3x_mmap/src/dbmodulechain.cpp
index 359cf626c3..ab0f788006 100644
--- a/plugins/Db3x_mmap/src/dbmodulechain.cpp
+++ b/plugins/Db3x_mmap/src/dbmodulechain.cpp
@@ -96,9 +96,9 @@ DWORD CDb3Mmap::GetModuleNameOfs(const char *szName)
dbmn.cbName = nameLen;
dbmn.ofsNext = m_dbHeader.ofsModuleNames;
m_dbHeader.ofsModuleNames = ofsNew;
- DBWrite(0, &m_dbHeader, sizeof(m_dbHeader));
DBWrite(ofsNew, &dbmn, offsetof(struct DBModuleName, name));
DBWrite(ofsNew + offsetof(struct DBModuleName, name), (PVOID)szName, nameLen);
+ DBWrite(0, &m_dbHeader, sizeof(m_dbHeader));
DBFlush(0);
// add to cache