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/AvatarHistory/src/AvatarDlg.cpp | 13 +++++++------ plugins/AvatarHistory/src/utils.cpp | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'plugins/AvatarHistory/src') diff --git a/plugins/AvatarHistory/src/AvatarDlg.cpp b/plugins/AvatarHistory/src/AvatarDlg.cpp index 0102758453..491d3d34be 100644 --- a/plugins/AvatarHistory/src/AvatarDlg.cpp +++ b/plugins/AvatarHistory/src/AvatarDlg.cpp @@ -139,8 +139,9 @@ static INT_PTR CALLBACK AvatarDlgProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM l if (displayName) { TCHAR title[MAX_PATH]; - mir_sntprintf(title,MAX_PATH,TranslateT("Avatar History for %s"),displayName); - SetWindowText(hwnd,title); + + mir_sntprintf(title, SIZEOF(title), TranslateT("Avatar History for %s"), displayName); + SetWindowText(hwnd, title); } SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)data->hContact); @@ -380,7 +381,7 @@ int FillAvatarListFromFiles(HWND list, MCONTACT hContact) WIN32_FIND_DATA finddata; GetContactFolder(dir, hContact); - mir_sntprintf(path, MAX_PATH, _T("%s\\*.*"), dir); + mir_sntprintf(path, SIZEOF(path), _T("%s\\*.*"), dir); HANDLE hFind = FindFirstFile(path, &finddata); if (hFind == INVALID_HANDLE_VALUE) @@ -390,7 +391,7 @@ int FillAvatarListFromFiles(HWND list, MCONTACT hContact) { if (finddata.cFileName[0] != '.') { - mir_sntprintf(path, MAX_PATH, _T("%s\\%s"), dir, finddata.cFileName); + mir_sntprintf(path, SIZEOF(path), _T("%s\\%s"), dir, finddata.cFileName); max_pos = AddFileToList(path,finddata.cFileName,finddata.cFileName,list); } } @@ -407,7 +408,7 @@ int FillAvatarListFromFolder(HWND list, MCONTACT hContact) WIN32_FIND_DATA finddata; GetContactFolder(dir, hContact); - mir_sntprintf(path, MAX_PATH, _T("%s\\*.lnk"), dir); + mir_sntprintf(path, SIZEOF(path), _T("%s\\*.lnk"), dir); HANDLE hFind = FindFirstFile(path, &finddata); if (hFind == INVALID_HANDLE_VALUE) @@ -418,7 +419,7 @@ int FillAvatarListFromFolder(HWND list, MCONTACT hContact) if (finddata.cFileName[0] != '.') { TCHAR lnk[MAX_PATH]; - mir_sntprintf(lnk, MAX_PATH, _T("%s\\%s"), dir, finddata.cFileName); + mir_sntprintf(lnk, SIZEOF(lnk), _T("%s\\%s"), dir, finddata.cFileName); if (ResolveShortcut(lnk, path)) max_pos = AddFileToList(path,lnk,finddata.cFileName,list); } diff --git a/plugins/AvatarHistory/src/utils.cpp b/plugins/AvatarHistory/src/utils.cpp index 4829ea83ed..4f9dc23773 100644 --- a/plugins/AvatarHistory/src/utils.cpp +++ b/plugins/AvatarHistory/src/utils.cpp @@ -151,7 +151,7 @@ TCHAR* GetContactFolder(TCHAR *fn, MCONTACT hContact) #ifdef DBGPOPUPS TCHAR log[1024]; - mir_sntprintf(log, MAX_REGS(log), _T("Path: %s\nProto: %S\nUIN: %s"), fn, proto, uin); + mir_sntprintf(log, SIZEOF(log), _T("Path: %s\nProto: %S\nUIN: %s"), fn, proto, uin); ShowPopup(hContact, _T("AVH Debug: GetContactFolder"), log); #endif -- cgit v1.2.3