summaryrefslogtreecommitdiff
path: root/plugins/Db3x_mmap/src/dbsettings.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-11-25 19:54:47 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-11-25 19:54:47 +0000
commite4c1b5ae00efaa470a4b41953656ff059d0fd87d (patch)
tree1dd416290ae1b9d58ac1da84b8462fcf8e3506da /plugins/Db3x_mmap/src/dbsettings.cpp
parent1b44de1b140c2155dde5c42172e4d9df2d43e843 (diff)
unique signature for the new mmap profile format
git-svn-id: http://svn.miranda-ng.org/main/trunk@6983 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Db3x_mmap/src/dbsettings.cpp')
-rw-r--r--plugins/Db3x_mmap/src/dbsettings.cpp22
1 files changed, 10 insertions, 12 deletions
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;