diff options
author | Rozhuk Ivan <rozhuk.im@gmail.com> | 2014-12-01 00:33:09 +0000 |
---|---|---|
committer | Rozhuk Ivan <rozhuk.im@gmail.com> | 2014-12-01 00:33:09 +0000 |
commit | faccf4803bd25abbb27402ab1127d085efd9061f (patch) | |
tree | 36ff52c5affad34aa47c98a18ca246ec474d13ec | |
parent | b2fad485cd5b41744ef0cc4a02722c021afd926c (diff) |
code cleanup
git-svn-id: http://svn.miranda-ng.org/main/trunk@11185 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | plugins/Console/src/Console.cpp | 2 | ||||
-rw-r--r-- | plugins/DbEditorPP/src/settinglist.cpp | 8 | ||||
-rw-r--r-- | plugins/DbEditorPP/src/watchedvars.cpp | 4 | ||||
-rw-r--r-- | plugins/MirOTR/MirOTR/src/options.cpp | 12 | ||||
-rwxr-xr-x | plugins/New_GPG/src/main.cpp | 12 | ||||
-rw-r--r-- | plugins/NewsAggregator/Src/Options.cpp | 12 | ||||
-rw-r--r-- | plugins/Spamotron/src/options.cpp | 19 | ||||
-rw-r--r-- | plugins/UserInfoEx/src/dlg_anniversarylist.cpp | 8 | ||||
-rw-r--r-- | plugins/WhenWasIt/src/dlg_handlers.cpp | 4 | ||||
-rw-r--r-- | plugins/YAPP/src/yapp_history_dlg.cpp | 4 | ||||
-rw-r--r-- | src/modules/database/profilemanager.cpp | 2 |
11 files changed, 42 insertions, 45 deletions
diff --git a/plugins/Console/src/Console.cpp b/plugins/Console/src/Console.cpp index 8353a799fc..df58465b5c 100644 --- a/plugins/Console/src/Console.cpp +++ b/plugins/Console/src/Console.cpp @@ -568,7 +568,7 @@ static INT_PTR CALLBACK LogDlgProc(HWND hwndDlg,UINT message,WPARAM wParam,LPARA while ((idx = ListView_GetNextItem(dat->hList, idx, flags)) > 0)
{
- ListView_GetItemText(dat->hList, idx, 0, szText, SIZEOF(szText)-1);
+ ListView_GetItemText(dat->hList, idx, 0, szText, SIZEOF(szText));
_ftprintf(fp, _T("%s\n"), szText);
}
fclose(fp);
diff --git a/plugins/DbEditorPP/src/settinglist.cpp b/plugins/DbEditorPP/src/settinglist.cpp index b3b5586ade..51c93605ae 100644 --- a/plugins/DbEditorPP/src/settinglist.cpp +++ b/plugins/DbEditorPP/src/settinglist.cpp @@ -658,8 +658,8 @@ INT_PTR CALLBACK SettingsCompare(LPARAM lParam1, LPARAM lParam2, LPARAM myParam) const int maxSize = 1024;
TCHAR text1[maxSize];
TCHAR text2[maxSize];
- ListView_GetItemText(params.hList, lParam1, params.column, text1, maxSize);
- ListView_GetItemText(params.hList, lParam2, params.column, text2, maxSize);
+ ListView_GetItemText(params.hList, lParam1, params.column, text1, SIZEOF(text1));
+ ListView_GetItemText(params.hList, lParam2, params.column, text2, SIZEOF(text2));
int res = _tcsicmp(text1, text2);
res = (params.column == lastColumn) ? -res : res;
@@ -710,7 +710,7 @@ void SettingsListWM_NOTIFY(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) char setting[256];
SendMessage(info->hwnd2Edit, WM_COMMAND, MAKEWPARAM(IDOK, 0), 0);
info->hwnd2Edit = NULL;
- ListView_GetItemText(GetDlgItem(hwnd, IDC_SETTINGS), hti.iItem, 0, setting, 256);
+ ListView_GetItemText(GetDlgItem(hwnd, IDC_SETTINGS), hti.iItem, 0, setting, SIZEOF(setting));
editSetting(info->hContact, info->module, setting);
}
else EditLabel(GetDlgItem(hwnd, IDC_SETTINGS), hti.iItem, hti.iSubItem);
@@ -839,7 +839,7 @@ void SettingsListRightClick(HWND hwnd, WPARAM wParam, LPARAM lParam) // hwnd her lvi.cchTextMax = SIZEOF(setting);
ListView_GetItem(hSettings, &lvi);
- ListView_GetItemText(hSettings, hti.iItem, 2, type, 8);
+ ListView_GetItemText(hSettings, hti.iItem, 2, type, SIZEOF(type));
switch (lvi.iImage) {
case 4: // STRING
diff --git a/plugins/DbEditorPP/src/watchedvars.cpp b/plugins/DbEditorPP/src/watchedvars.cpp index 1f1a483bdd..e2500cdcd6 100644 --- a/plugins/DbEditorPP/src/watchedvars.cpp +++ b/plugins/DbEditorPP/src/watchedvars.cpp @@ -264,8 +264,8 @@ INT_PTR CALLBACK WatchDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) {
ItemInfo ii;
ii.hContact = (MCONTACT)lvi.lParam;
- ListView_GetItemText(GetDlgItem(hwnd,IDC_VARS),hti.iItem,1,ii.module,128);
- ListView_GetItemText(GetDlgItem(hwnd,IDC_VARS),hti.iItem,2,ii.setting,128);
+ ListView_GetItemText(GetDlgItem(hwnd, IDC_VARS), hti.iItem, 1, ii.module, SIZEOF(ii.module));
+ ListView_GetItemText(GetDlgItem(hwnd, IDC_VARS), hti.iItem, 2, ii.setting, SIZEOF(ii.setting));
ii.type = FW_SETTINGNAME;
SendMessage(hwnd2mainWindow,WM_FINDITEM,(WPARAM)&ii,0);
}
diff --git a/plugins/MirOTR/MirOTR/src/options.cpp b/plugins/MirOTR/MirOTR/src/options.cpp index e49c2bb7d2..c1b0024b9a 100644 --- a/plugins/MirOTR/MirOTR/src/options.cpp +++ b/plugins/MirOTR/MirOTR/src/options.cpp @@ -402,7 +402,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsProto(HWND hwndDlg, UINT msg, WPARAM wP if (sel != -1) {
PROTOREGENKEYOPTIONS *opts = new PROTOREGENKEYOPTIONS();
opts->refresh = hwndDlg;
- ListView_GetItemText(GetDlgItem(hwndDlg, IDC_LV_PROTO_PROTOS), sel, 0, opts->proto, 128);
+ ListView_GetItemText(GetDlgItem(hwndDlg, IDC_LV_PROTO_PROTOS), sel, 0, opts->proto, SIZEOF(opts->proto));
CloseHandle((HANDLE)_beginthreadex(0, 0, regen_key_thread, opts, 0, 0));
}
}break;
@@ -463,7 +463,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsProto(HWND hwndDlg, UINT msg, WPARAM wP EnableWindow(GetDlgItem(hwndDlg, IDC_BTN_PROTO_NEWKEY), TRUE);
EnableWindow(GetDlgItem(hwndDlg, IDC_BTN_PROTO_FORGET), TRUE);
TCHAR buff[50];
- ListView_GetItemText(((LPNMHDR)lParam)->hwndFrom, sel, 1, buff, 50);
+ ListView_GetItemText(((LPNMHDR)lParam)->hwndFrom, sel, 1, buff, SIZEOF(buff));
SendMessage(GetDlgItem(hwndDlg, IDC_CMB_PROTO_POLICY), CB_SELECTSTRING, (LPARAM)-1, (WPARAM)buff);
}
@@ -473,8 +473,8 @@ static INT_PTR CALLBACK DlgProcMirOTROptsProto(HWND hwndDlg, UINT msg, WPARAM wP TCHAR proto_t[128], policy[64];
char* proto;
for (int i = 0; i < cnt; ++i) {
- ListView_GetItemText(lv, i, 0, proto_t, 128);
- ListView_GetItemText(lv, i, 1, policy, 64);
+ ListView_GetItemText(lv, i, 0, proto_t, SIZEOF(proto_t));
+ ListView_GetItemText(lv, i, 1, policy, SIZEOF(policy));
proto = mir_t2a(proto_t);
db_set_dw(0, MODULENAME"_ProtoPol", proto, policy_from_string(policy));
mir_free(proto);
@@ -637,7 +637,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsContacts(HWND hwndDlg, UINT msg, WPARAM } else {
EnableWindow(GetDlgItem(hwndDlg, IDC_CMB_CONT_POLICY), TRUE);
TCHAR buff[50];
- ListView_GetItemText(((LPNMHDR)lParam)->hwndFrom, sel, 2, buff, 50);
+ ListView_GetItemText(((LPNMHDR)lParam)->hwndFrom, sel, 2, buff, SIZEOF(buff));
SendMessage(GetDlgItem(hwndDlg, IDC_CMB_CONT_POLICY), CB_SELECTSTRING, (LPARAM)-1, (WPARAM)buff);
}
} else if (code == (UINT) NM_CLICK) {
@@ -652,7 +652,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsContacts(HWND hwndDlg, UINT msg, WPARAM MCONTACT hContact = (MCONTACT)lvi.lParam;
ContactPolicyMap *cp = (ContactPolicyMap *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
TCHAR buff[50];
- ListView_GetItemText(((LPNMHDR)lParam)->hwndFrom, lvi.iItem, 3, buff, 50);
+ ListView_GetItemText(((LPNMHDR)lParam)->hwndFrom, lvi.iItem, 3, buff, SIZEOF(buff));
if (_tcsncmp(buff, TranslateT(LANG_YES), 50)==0){
(*cp)[hContact].htmlconv = HTMLCONV_DISABLE;
ListView_SetItemText(((LPNMHDR)lParam)->hwndFrom, lvi.iItem, 3, TranslateT(LANG_NO));
diff --git a/plugins/New_GPG/src/main.cpp b/plugins/New_GPG/src/main.cpp index 5a051a1208..ae5785ea2b 100755 --- a/plugins/New_GPG/src/main.cpp +++ b/plugins/New_GPG/src/main.cpp @@ -289,7 +289,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR break; case ID_OK: { - ListView_GetItemText(hwndList, itemnum, 0, fp, 16); + ListView_GetItemText(hwndList, itemnum, 0, fp, SIZEOF(fp)); TCHAR *name = new TCHAR [64]; ListView_GetItemText(hwndList, itemnum, 2, name, 64); { @@ -449,7 +449,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR } break; case IDC_DELETE_KEY: - ListView_GetItemText(hwndList, itemnum, 0, fp, 16); + ListView_GetItemText(hwndList, itemnum, 0, fp, SIZEOF(fp)); { string out; DWORD code; @@ -677,7 +677,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR { if(OpenClipboard(hwndDlg)) { - ListView_GetItemText(hwndList, itemnum, 0, fp, 16); + ListView_GetItemText(hwndList, itemnum, 0, fp, SIZEOF(fp)); string out; DWORD code; std::vector<wstring> cmd; @@ -742,7 +742,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR mir_free(path); if(!file.is_open()) break; //TODO: handle error - ListView_GetItemText(hwndList, itemnum, 0, fp, 16); + ListView_GetItemText(hwndList, itemnum, 0, fp, SIZEOF(fp)); string out; DWORD code; std::vector<wstring> cmd; @@ -768,7 +768,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR } break; case IDC_CHANGE_PASSWD: - ListView_GetItemText(hwndList, itemnum, 0, key_id_global, 16); + ListView_GetItemText(hwndList, itemnum, 0, key_id_global, SIZEOF(key_id_global)); // extern void ShowChangePasswdDlg(); // ShowChangePasswdDlg(); //temporary code follows @@ -1804,7 +1804,7 @@ static INT_PTR CALLBACK DlgProcLoadExistingKey(HWND hwndDlg,UINT msg,WPARAM wPar { case IDOK: { - ListView_GetItemText(hwndList, itemnum2, 0, id, 16); + ListView_GetItemText(hwndList, itemnum2, 0, id, SIZEOF(id)); extern HWND hPubKeyEdit; string out; DWORD code; diff --git a/plugins/NewsAggregator/Src/Options.cpp b/plugins/NewsAggregator/Src/Options.cpp index 198b78d701..4a8eec870c 100644 --- a/plugins/NewsAggregator/Src/Options.cpp +++ b/plugins/NewsAggregator/Src/Options.cpp @@ -483,8 +483,8 @@ INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPA sel = ListView_GetSelectionMark(hwndList);
{
ItemInfo SelItem = { 0 };
- ListView_GetItemText(hwndList, sel, 0, SelItem.nick, MAX_PATH);
- ListView_GetItemText(hwndList, sel, 1, SelItem.url, MAX_PATH);
+ ListView_GetItemText(hwndList, sel, 0, SelItem.nick, SIZEOF(SelItem.nick));
+ ListView_GetItemText(hwndList, sel, 1, SelItem.url, SIZEOF(SelItem.url));
SelItem.hwndList = hwndList;
SelItem.SelNumber = sel;
CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_ADDFEED), hwndDlg, DlgProcChangeFeedOpts, (LPARAM)&SelItem);
@@ -495,8 +495,8 @@ INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPA if (MessageBox(hwndDlg, TranslateT("Are you sure?"), TranslateT("Contact deleting"), MB_YESNO | MB_ICONWARNING) == IDYES) {
TCHAR nick[MAX_PATH], url[MAX_PATH];
int sel = ListView_GetSelectionMark(hwndList);
- ListView_GetItemText(hwndList, sel, 0, nick, MAX_PATH);
- ListView_GetItemText(hwndList, sel, 1, url, MAX_PATH);
+ ListView_GetItemText(hwndList, sel, 0, nick, SIZEOF(nick));
+ ListView_GetItemText(hwndList, sel, 1, url, SIZEOF(url));
for (MCONTACT hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) {
ptrT dbNick(db_get_tsa(hContact, MODULE, "Nick"));
@@ -554,8 +554,8 @@ INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPA sel = ListView_GetHotItem(hwndList);
if (sel != -1) {
ItemInfo SelItem = { 0 };
- ListView_GetItemText(hwndList, sel, 0, SelItem.nick, MAX_PATH);
- ListView_GetItemText(hwndList, sel, 1, SelItem.url, MAX_PATH);
+ ListView_GetItemText(hwndList, sel, 0, SelItem.nick, SIZEOF(SelItem.nick));
+ ListView_GetItemText(hwndList, sel, 1, SelItem.url, SIZEOF(SelItem.url));
SelItem.hwndList = hwndList;
SelItem.SelNumber = sel;
CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_ADDFEED), hwndDlg, DlgProcChangeFeedOpts, (LPARAM)&SelItem);
diff --git a/plugins/Spamotron/src/options.cpp b/plugins/Spamotron/src/options.cpp index 88f614d7d6..28e5814e11 100644 --- a/plugins/Spamotron/src/options.cpp +++ b/plugins/Spamotron/src/options.cpp @@ -93,14 +93,14 @@ INT_PTR CALLBACK DlgProcOptionsMain(HWND optDlg, UINT msg, WPARAM wParam, LPARAM {
static int bInitializing = 0, i, j, numProtocols;
PROTOCOLDESCRIPTOR** pd;
- TCHAR pName[200] = {0};
+ TCHAR pName[256] = {0};
char protoOption[256] = {0};
char protoName[256] = {0};
HWND hProtocolsList = GetDlgItem(optDlg, IDC_OPT_PROTOCOLS);
LVITEM lvi = {0};
LVCOLUMN lvc = {0};
- TCHAR *buf;
- int buflen = 500;
+ TCHAR buf[512];
+
switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(optDlg);
@@ -114,12 +114,11 @@ INT_PTR CALLBACK DlgProcOptionsMain(HWND optDlg, UINT msg, WPARAM wParam, LPARAM SendDlgItemMessage(optDlg, IDC_OPT_HIDE_UNTIL_VERIFIED, BM_SETCHECK, _getOptB("HideUnverified", defaultHideUnverified), 0);
SendDlgItemMessage(optDlg, IDC_OPT_ADD_PERMANENTLY, BM_SETCHECK, _getOptB("AddPermanently", defaultAddPermanently), 0);
SendDlgItemMessage(optDlg, IDC_OPT_LOG_ACTIONS, BM_SETCHECK, _getOptB("LogActions", defaultLogActions), 0);
- buf = (TCHAR *)mir_alloc(buflen*sizeof(TCHAR));
- SetDlgItemText(optDlg, IDC_OPT_IN_MSG_APPROVE_WORDLIST, _getOptS(buf, buflen, "ApproveOnMsgInWordlist", defaultApproveOnMsgInWordlist));
+
+ SetDlgItemText(optDlg, IDC_OPT_IN_MSG_APPROVE_WORDLIST, _getOptS(buf, SIZEOF(buf), "ApproveOnMsgInWordlist", defaultApproveOnMsgInWordlist));
SetDlgItemText(optDlg, IDC_OPT_MAX_MSG_CONTACT, _itot((unsigned int)_getOptD("MaxMsgContactCountPerDay", defaultMaxMsgContactCountPerDay), buf, 10));
SetDlgItemText(optDlg, IDC_OPT_MAX_SAME_MSG, _itot((unsigned int)_getOptD("MaxSameMsgCountPerDay", defaultMaxSameMsgCountPerDay), buf, 10));
- SetDlgItemText(optDlg, IDC_OPT_DONT_REPLY_MSG_WORDLIST, _getOptS(buf, buflen, "DontReplyMsgWordlist", defaultDontReplyMsgWordlist));
- mir_free(buf);
+ SetDlgItemText(optDlg, IDC_OPT_DONT_REPLY_MSG_WORDLIST, _getOptS(buf, SIZEOF(buf), "DontReplyMsgWordlist", defaultDontReplyMsgWordlist));
///Individual protocols list
ListView_SetExtendedListViewStyle(hProtocolsList, LVS_EX_CHECKBOXES | LVS_EX_FULLROWSELECT);
@@ -197,16 +196,14 @@ INT_PTR CALLBACK DlgProcOptionsMain(HWND optDlg, UINT msg, WPARAM wParam, LPARAM _saveDlgItemInt(optDlg, IDC_OPT_MAX_MSG_CONTACT, "MaxMsgContactCountPerDay");
_saveDlgItemInt(optDlg, IDC_OPT_MAX_SAME_MSG, "MaxSameMsgCountPerDay");
numProtocols = ListView_GetItemCount(hProtocolsList);
- buf = (TCHAR *)malloc(256*sizeof(TCHAR *));
for (i = 0; i < numProtocols; i++) {
- ListView_GetItemText(hProtocolsList, i, 0, buf, 256);
- //wcstombs(protoName, buf, 256);
+ ListView_GetItemText(hProtocolsList, i, 0, buf, SIZEOF(buf));
+ //wcstombs(protoName, buf, SIZEOF(buf));
memset(protoOption, 0, sizeof(protoOption));
strcat(protoOption, "proto_");
strcat(protoOption, mir_u2a(buf));
_setOptB(protoOption, ListView_GetCheckState(hProtocolsList, i));
}
- free(buf);
return TRUE;
}
break;
diff --git a/plugins/UserInfoEx/src/dlg_anniversarylist.cpp b/plugins/UserInfoEx/src/dlg_anniversarylist.cpp index e7776df2dc..234c070383 100644 --- a/plugins/UserInfoEx/src/dlg_anniversarylist.cpp +++ b/plugins/UserInfoEx/src/dlg_anniversarylist.cpp @@ -240,15 +240,15 @@ class CAnnivList case COLUMN_CONTACT:
case COLUMN_PROTO:
case COLUMN_DESC:
- ListView_GetItemText(pDlg->_hList, iItem1, pDlg->_sortHeader, szText1, MAX_PATH);
- ListView_GetItemText(pDlg->_hList, iItem2, pDlg->_sortHeader, szText2, MAX_PATH);
+ ListView_GetItemText(pDlg->_hList, iItem1, pDlg->_sortHeader, szText1, SIZEOF(szText1));
+ ListView_GetItemText(pDlg->_hList, iItem2, pDlg->_sortHeader, szText2, SIZEOF(szText2));
result = pDlg->_sortOrder * mir_tstrcmp(szText1, szText2);
break;
case COLUMN_AGE:
case COLUMN_ETA:
- ListView_GetItemText(pDlg->_hList, iItem1, pDlg->_sortHeader, szText1, MAX_PATH);
- ListView_GetItemText(pDlg->_hList, iItem2, pDlg->_sortHeader, szText2, MAX_PATH);
+ ListView_GetItemText(pDlg->_hList, iItem1, pDlg->_sortHeader, szText1, SIZEOF(szText1));
+ ListView_GetItemText(pDlg->_hList, iItem2, pDlg->_sortHeader, szText2, SIZEOF(szText2));
result = pDlg->_sortOrder * (_ttoi(szText1) - _ttoi(szText2));
break;
diff --git a/plugins/WhenWasIt/src/dlg_handlers.cpp b/plugins/WhenWasIt/src/dlg_handlers.cpp index ea306c9e1e..bba0131142 100644 --- a/plugins/WhenWasIt/src/dlg_handlers.cpp +++ b/plugins/WhenWasIt/src/dlg_handlers.cpp @@ -542,8 +542,8 @@ INT_PTR CALLBACK BirthdaysCompare(LPARAM lParam1, LPARAM lParam2, LPARAM myParam TCHAR text1[maxSize];
TCHAR text2[maxSize];
long value1, value2;
- ListView_GetItemText(params.hList, (int)lParam1, params.column, text1, maxSize);
- ListView_GetItemText(params.hList, (int)lParam2, params.column, text2, maxSize);
+ ListView_GetItemText(params.hList, (int)lParam1, params.column, text1, SIZEOF(text1));
+ ListView_GetItemText(params.hList, (int)lParam2, params.column, text2, SIZEOF(text2));
int res = 0;
diff --git a/plugins/YAPP/src/yapp_history_dlg.cpp b/plugins/YAPP/src/yapp_history_dlg.cpp index 1ab052a9fd..2c553a68bf 100644 --- a/plugins/YAPP/src/yapp_history_dlg.cpp +++ b/plugins/YAPP/src/yapp_history_dlg.cpp @@ -182,8 +182,8 @@ int CALLBACK PopupsCompare(LPARAM lParam1, LPARAM lParam2, LPARAM myParam) TCHAR text2[MAX_SIZE];
int res;
- ListView_GetItemText(params.hList, (int) lParam1, params.column, text1, MAX_SIZE);
- ListView_GetItemText(params.hList, (int) lParam2, params.column, text2, MAX_SIZE);
+ ListView_GetItemText(params.hList, (int) lParam1, params.column, text1, SIZEOF(text1));
+ ListView_GetItemText(params.hList, (int) lParam2, params.column, text2, SIZEOF(text2));
res = _tcsicmp(text1, text2);
diff --git a/src/modules/database/profilemanager.cpp b/src/modules/database/profilemanager.cpp index c7bd537245..b15f1a74e4 100644 --- a/src/modules/database/profilemanager.cpp +++ b/src/modules/database/profilemanager.cpp @@ -587,7 +587,7 @@ static INT_PTR CALLBACK DlgProfileSelect(HWND hwndDlg, UINT msg, WPARAM wParam, if (pInfoTip != NULL) { TCHAR profilename[MAX_PATH], tszFullPath[MAX_PATH]; struct _stat statbuf; - ListView_GetItemText(hwndList, pInfoTip->iItem, 0, profilename, MAX_PATH); + ListView_GetItemText(hwndList, pInfoTip->iItem, 0, profilename, SIZEOF(profilename)); mir_sntprintf(tszFullPath, SIZEOF(tszFullPath), _T("%s\\%s\\%s.dat"), dat->pd->ptszProfileDir, profilename, profilename); _tstat(tszFullPath, &statbuf); mir_sntprintf(pInfoTip->pszText, pInfoTip->cchTextMax, _T("%s\n%s: %s\n%s: %s"), tszFullPath, TranslateT("Created"), rtrimt(NEWTSTR_ALLOCA(_tctime(&statbuf.st_ctime))), TranslateT("Modified"), rtrimt(NEWTSTR_ALLOCA(_tctime(&statbuf.st_mtime)))); |