summaryrefslogtreecommitdiff
path: root/plugins/ContactsPlus/src/receive.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2021-06-05 17:50:34 +0300
committerGeorge Hazan <ghazan@miranda.im>2021-06-05 17:50:34 +0300
commitd7c9eb34f80f207efd47d2fc65e31aedf166c323 (patch)
tree338b9b905674dc31b1efab739dfcedeed3d8d7b3 /plugins/ContactsPlus/src/receive.cpp
parentffc5a3d7550528281976745279e77ac9faba551b (diff)
major code cleaning in regard to db_event_getBlobSize & event memory allocation
Diffstat (limited to 'plugins/ContactsPlus/src/receive.cpp')
-rw-r--r--plugins/ContactsPlus/src/receive.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/plugins/ContactsPlus/src/receive.cpp b/plugins/ContactsPlus/src/receive.cpp
index f4a0b1335d..da8b2230f3 100644
--- a/plugins/ContactsPlus/src/receive.cpp
+++ b/plugins/ContactsPlus/src/receive.cpp
@@ -195,11 +195,9 @@ INT_PTR CALLBACK RecvDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
CheckDlgButton(hwndDlg, IDC_ENABLEGROUPS, BST_UNCHECKED);
RebuildGroupCombo(hwndDlg);
- { // fill listview with received contacts
- DBEVENTINFO dbe = {};
- dbe.cbBlob = db_event_getBlobSize(wndData->mhDbEvent);
- if (dbe.cbBlob != -1) // this marks an invalid hDbEvent - all smashed anyway...
- dbe.pBlob = (PBYTE)_alloca(dbe.cbBlob);
+ { // fill listview with received contacts
+ DB::EventInfo dbe;
+ dbe.cbBlob = -1;
db_event_get(wndData->mhDbEvent, &dbe);
char* pcBlob = (char*)dbe.pBlob;
char* pcEnd = (char*)dbe.pBlob + dbe.cbBlob;
@@ -212,8 +210,7 @@ INT_PTR CALLBACK RecvDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
lvi.iImage = 0;
lvi.mask = LVIF_TEXT | LVIF_IMAGE;
- for (int nItem = 0; ; nItem++)
- { // Nick
+ for (int nItem = 0; ; nItem++) { // Nick
int strsize = (int)strlennull(pcBlob);
TReceivedItem* pItem = wndData->AddReceivedItem();