diff options
author | George Hazan <george.hazan@gmail.com> | 2015-06-19 19:35:42 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-06-19 19:35:42 +0000 |
commit | 4c814798c7bc7f6a0f92c21b027b26290622aa2f (patch) | |
tree | 9bbfb38bd639f352300aa16ff7c45f5a9b2dba6d /plugins/Utils/mir_options.cpp | |
parent | f0f0cd088f1ec3a85abee825ddbc214f3f6b92c3 (diff) |
SIZEOF replaced with more secure analog - _countof
git-svn-id: http://svn.miranda-ng.org/main/trunk@14270 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Utils/mir_options.cpp')
-rw-r--r-- | plugins/Utils/mir_options.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/plugins/Utils/mir_options.cpp b/plugins/Utils/mir_options.cpp index 9618b51c4f..b65b7645e6 100644 --- a/plugins/Utils/mir_options.cpp +++ b/plugins/Utils/mir_options.cpp @@ -70,8 +70,8 @@ static void PathToRelative(TCHAR *pOut, size_t outSize, const TCHAR *pSrc) else {
if (dbPath[0] == _T('\0')) {
char tmp[1024];
- CallService(MS_DB_GETPROFILEPATH, SIZEOF(tmp), (LPARAM)tmp);
- mir_sntprintf(dbPath, SIZEOF(dbPath), _T("%S\\"), tmp);
+ CallService(MS_DB_GETPROFILEPATH, _countof(tmp), (LPARAM)tmp);
+ mir_sntprintf(dbPath, _countof(dbPath), _T("%S\\"), tmp);
}
size_t len = mir_tstrlen(dbPath);
@@ -88,8 +88,8 @@ static void PathToAbsolute(TCHAR *pOut, size_t outSize, const TCHAR *pSrc) else {
if (dbPath[0] == _T('\0')) {
char tmp[1024];
- CallService(MS_DB_GETPROFILEPATH, SIZEOF(tmp), (LPARAM)tmp);
- mir_sntprintf(dbPath, SIZEOF(dbPath), _T("%S\\"), tmp);
+ CallService(MS_DB_GETPROFILEPATH, _countof(tmp), (LPARAM)tmp);
+ mir_sntprintf(dbPath, _countof(dbPath), _T("%S\\"), tmp);
}
mir_sntprintf(pOut, outSize, _T("%s%s"), dbPath, pSrc);
@@ -360,7 +360,7 @@ INT_PTR CALLBACK SaveOptsDlgProc(OptPageControl *controls, int controlsSize, cha case CONTROL_TEXT:
{
TCHAR tmp[1024];
- GetDlgItemText(hwndDlg, ctrl->nID, tmp, SIZEOF(tmp));
+ GetDlgItemText(hwndDlg, ctrl->nID, tmp, _countof(tmp));
db_set_ts(NULL, module, ctrl->setting, tmp);
}
break;
@@ -381,7 +381,7 @@ INT_PTR CALLBACK SaveOptsDlgProc(OptPageControl *controls, int controlsSize, cha case CONTROL_FILE:
{
TCHAR tmp[1024];
- GetDlgItemText(hwndDlg, ctrl->nID, tmp, SIZEOF(tmp));
+ GetDlgItemText(hwndDlg, ctrl->nID, tmp, _countof(tmp));
TCHAR rel[1024];
PathToRelative(rel, 1024, tmp);
db_set_ts(NULL, module, ctrl->setting, rel);
@@ -390,7 +390,7 @@ INT_PTR CALLBACK SaveOptsDlgProc(OptPageControl *controls, int controlsSize, cha case CONTROL_COMBO_TEXT:
{
TCHAR tmp[1024];
- GetDlgItemText(hwndDlg, ctrl->nID, tmp, SIZEOF(tmp));
+ GetDlgItemText(hwndDlg, ctrl->nID, tmp, _countof(tmp));
db_set_ts(NULL, module, ctrl->setting, tmp);
}
break;
|