From e4c1b5ae00efaa470a4b41953656ff059d0fd87d Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 25 Nov 2013 19:54:47 +0000 Subject: unique signature for the new mmap profile format git-svn-id: http://svn.miranda-ng.org/main/trunk@6983 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Db3x_mmap/src/dbsettings.cpp | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'plugins/Db3x_mmap/src/dbsettings.cpp') diff --git a/plugins/Db3x_mmap/src/dbsettings.cpp b/plugins/Db3x_mmap/src/dbsettings.cpp index 45e9c5fa82..eafc619f0c 100644 --- a/plugins/Db3x_mmap/src/dbsettings.cpp +++ b/plugins/Db3x_mmap/src/dbsettings.cpp @@ -475,7 +475,7 @@ STDMETHODIMP_(BOOL) CDb3Base::WriteContactSetting(HANDLE hContact, DBCONTACTWRIT } else bytesRequired = tmp.value.type; bytesRequired += 2 + settingNameLen; - bytesRequired += (DB_SETTINGS_RESIZE_GRANULARITY - (bytesRequired%DB_SETTINGS_RESIZE_GRANULARITY)) % DB_SETTINGS_RESIZE_GRANULARITY; + bytesRequired += (DB_SETTINGS_RESIZE_GRANULARITY - (bytesRequired % DB_SETTINGS_RESIZE_GRANULARITY)) % DB_SETTINGS_RESIZE_GRANULARITY; ofsSettingsGroup = CreateNewSpace(bytesRequired + offsetof(DBContactSettings, blob)); dbcs.signature = DBCONTACTSETTINGS_SIGNATURE; dbcs.ofsNext = dbc.ofsFirstSettings; @@ -612,22 +612,20 @@ STDMETHODIMP_(BOOL) CDb3Base::WriteContactSetting(HANDLE hContact, DBCONTACTWRIT case DBVT_BYTE: DBWrite(ofsBlobPtr, &tmp.value.bVal, 1); MoveAlong(1); break; case DBVT_WORD: DBWrite(ofsBlobPtr, &tmp.value.wVal, 2); MoveAlong(2); break; case DBVT_DWORD: DBWrite(ofsBlobPtr, &tmp.value.dVal, 4); MoveAlong(4); break; - case DBVT_UTF8: - case DBVT_ASCIIZ: - { - int len = (int)strlen(tmp.value.pszVal); - if (bIsEncrypted) - EncodeString(tmp.value.pszVal); - DBWrite(ofsBlobPtr, &len, 2); - DBWrite(ofsBlobPtr + 2, tmp.value.pszVal, len); // encode - MoveAlong(2 + len); - } - break; case DBVT_BLOB: DBWrite(ofsBlobPtr, &tmp.value.cpbVal, 2); DBWrite(ofsBlobPtr + 2, tmp.value.pbVal, tmp.value.cpbVal); // encode MoveAlong(2 + tmp.value.cpbVal); break; + case DBVT_UTF8: + case DBVT_ASCIIZ: + int len = (int)strlen(tmp.value.pszVal); + if (bIsEncrypted) + EncodeString(tmp.value.pszVal); + DBWrite(ofsBlobPtr, &len, 2); + DBWrite(ofsBlobPtr + 2, tmp.value.pszVal, len); // encode + MoveAlong(2 + len); + break; } BYTE zero = 0; -- cgit v1.2.3