diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2014-12-30 22:43:22 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2014-12-30 22:43:22 +0000 |
commit | 67a8ad248d3517c9d74fc3c1909afcb4af0d7d6c (patch) | |
tree | b956bae41bae883d7495bc4c33d8fa701e208686 /plugins/NewXstatusNotify/src/popup.cpp | |
parent | efe64be035fa04d5db79e75b8d2ce227c96e0c67 (diff) |
memory corruption fix
git-svn-id: http://svn.miranda-ng.org/main/trunk@11688 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/NewXstatusNotify/src/popup.cpp')
-rw-r--r-- | plugins/NewXstatusNotify/src/popup.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/plugins/NewXstatusNotify/src/popup.cpp b/plugins/NewXstatusNotify/src/popup.cpp index 13e13d4d08..f57710a6ee 100644 --- a/plugins/NewXstatusNotify/src/popup.cpp +++ b/plugins/NewXstatusNotify/src/popup.cpp @@ -25,19 +25,16 @@ void ShowChangePopup(MCONTACT hContact, HICON hIcon, WORD newStatus, TCHAR *stzT {
POPUPDATAT ppd = { 0 };
ppd.lchContact = hContact;
- ppd.lchIcon = hIcon;//LoadSkinnedProtoIcon(szProto, iconStatus);
- _tcsncpy(ppd.lptzContactName, (TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GSMDF_TCHAR), MAX_CONTACTNAME);
+ ppd.lchIcon = hIcon;
+ CMString buf((TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GSMDF_TCHAR));
// add group name to popup title
if (opt.ShowGroup) {
- DBVARIANT dbv;
- if (!db_get_ts(hContact, "CList", "Group", &dbv)) {
- _tcsncat(ppd.lptzContactName, _T(" ("), MAX_CONTACTNAME);
- _tcsncat(ppd.lptzContactName, dbv.ptszVal, MAX_CONTACTNAME);
- _tcsncat(ppd.lptzContactName, _T(")"), MAX_CONTACTNAME);
- db_free(&dbv);
- }
+ ptrT tszGroup(db_get_tsa(hContact, "CList", "Group"));
+ if (tszGroup)
+ buf.AppendFormat(_T(" (%s)"), tszGroup);
}
+ _tcsncpy_s(ppd.lptzContactName, buf, _TRUNCATE);
_tcsncpy(ppd.lptzText, stzText, MAX_SECONDLINE);
|