From 36472b00443e23acf28b0dd26ddc2c2e6216d909 Mon Sep 17 00:00:00 2001 From: Rozhuk Ivan Date: Tue, 9 Dec 2014 00:59:27 +0000 Subject: code cleanup over mir_sntprintf + small bug fix git-svn-id: http://svn.miranda-ng.org/main/trunk@11295 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/QuickContacts/src/quickcontacts.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'plugins/QuickContacts') diff --git a/plugins/QuickContacts/src/quickcontacts.cpp b/plugins/QuickContacts/src/quickcontacts.cpp index 861e899084..bc9fd1f734 100644 --- a/plugins/QuickContacts/src/quickcontacts.cpp +++ b/plugins/QuickContacts/src/quickcontacts.cpp @@ -708,11 +708,12 @@ BOOL MoveWindow(HWND hWnd, const RECT &rect, BOOL bRepaint) static void FillButton(HWND hwndDlg, int dlgItem, TCHAR *name, TCHAR *key, HICON icon) { TCHAR tmp[256]; - TCHAR *full; + TCHAR *full = tmp; + if (key == NULL) full = TranslateTS(name); else - mir_sntprintf(full = tmp, SIZEOF(tmp), _T("%s (%s)"), TranslateTS(name), key); + mir_sntprintf(tmp, SIZEOF(tmp), _T("%s (%s)"), TranslateTS(name), key); SendMessage(GetDlgItem(hwndDlg, dlgItem), BUTTONSETASFLATBTN, 0, 0); SendMessage(GetDlgItem(hwndDlg, dlgItem), BUTTONADDTOOLTIP, (LPARAM) full, BATF_TCHAR); @@ -723,11 +724,12 @@ static void FillButton(HWND hwndDlg, int dlgItem, TCHAR *name, TCHAR *key, HICON static void FillCheckbox(HWND hwndDlg, int dlgItem, TCHAR *name, TCHAR *key) { TCHAR tmp[256]; - TCHAR *full; + TCHAR *full = tmp; + if (key == NULL) full = TranslateTS(name); else - mir_sntprintf(full = tmp, SIZEOF(tmp), _T("%s (%s)"), TranslateTS(name), key); + mir_sntprintf(tmp, SIZEOF(tmp), _T("%s (%s)"), TranslateTS(name), key); SendMessage(GetDlgItem(hwndDlg, dlgItem), WM_SETTEXT, 0, (LPARAM) full); } -- cgit v1.2.3