From 585beea01e6e45ea8ce1464dd92e768b46fb9b55 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 28 Dec 2015 11:05:11 +0000 Subject: 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 --- plugins/Db3x_mmap/src/dbmodulechain.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit v1.2.3