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/Folders/src | |
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/Folders/src')
-rw-r--r-- | plugins/Folders/src/dlg_handlers.cpp | 4 | ||||
-rw-r--r-- | plugins/Folders/src/folderItem.cpp | 4 | ||||
-rw-r--r-- | plugins/Folders/src/services.cpp | 8 |
3 files changed, 8 insertions, 8 deletions
diff --git a/plugins/Folders/src/dlg_handlers.cpp b/plugins/Folders/src/dlg_handlers.cpp index ff347d9ba2..b5e6668912 100644 --- a/plugins/Folders/src/dlg_handlers.cpp +++ b/plugins/Folders/src/dlg_handlers.cpp @@ -91,7 +91,7 @@ static void SaveItem(HWND hWnd, PFolderItem item, int bEnableApply) return;
TCHAR buffer[MAX_FOLDER_SIZE];
- GetEditText(hWnd, buffer, SIZEOF(buffer));
+ GetEditText(hWnd, buffer, _countof(buffer));
item->SetFormat(buffer);
if (bEnableApply)
@@ -123,7 +123,7 @@ static INT_PTR CALLBACK DlgProcVariables(HWND hWnd, UINT msg, WPARAM wParam, LPA switch (msg) {
case WM_INITDIALOG:
- mir_sntprintf(tszMessage, SIZEOF(tszMessage), _T("%s\r\n%s\r\n\r\n%s\t\t%s\r\n%%miranda_path%%\t\t%s\r\n%%profile_path%%\t\t%s\r\n\t\t\t%s\r\n%%current_profile%%\t\t%s\r\n\t\t\t%s\r\n\r\n\r\n%s\r\n%s\r\n%s\r\n%s\r\n%s\r\n%s\r\n\r\n%s\r\n%s\r\n%s\r\n%%miranda_path%%\t\t\t%s\r\n%%profile_path%%\t\t\t%s\r\n%%current_profile%%\t\t\t%s\r\n%%temp%%\t\t\t\t%s\r\n%%profile_path%%\\%%current_profile%%\t%s\r\n%%miranda_path%%\\plugins\\config\t%s\r\n' %%miranda_path%%\\\\\\\\ '\t\t%s\r\n\r\n%s"),
+ mir_sntprintf(tszMessage, _countof(tszMessage), _T("%s\r\n%s\r\n\r\n%s\t\t%s\r\n%%miranda_path%%\t\t%s\r\n%%profile_path%%\t\t%s\r\n\t\t\t%s\r\n%%current_profile%%\t\t%s\r\n\t\t\t%s\r\n\r\n\r\n%s\r\n%s\r\n%s\r\n%s\r\n%s\r\n%s\r\n\r\n%s\r\n%s\r\n%s\r\n%%miranda_path%%\t\t\t%s\r\n%%profile_path%%\t\t\t%s\r\n%%current_profile%%\t\t\t%s\r\n%%temp%%\t\t\t\t%s\r\n%%profile_path%%\\%%current_profile%%\t%s\r\n%%miranda_path%%\\plugins\\config\t%s\r\n' %%miranda_path%%\\\\\\\\ '\t\t%s\r\n\r\n%s"),
TranslateT("Don't forget to click on Apply to save the changes. If you don't then the changes won't"),
TranslateT("be saved to the database, they will only be valid for this session."),
TranslateT("Variable string"),
diff --git a/plugins/Folders/src/folderItem.cpp b/plugins/Folders/src/folderItem.cpp index a66984ab7e..22043a172c 100644 --- a/plugins/Folders/src/folderItem.cpp +++ b/plugins/Folders/src/folderItem.cpp @@ -114,8 +114,8 @@ int CFolderItem::FolderDeleteOldDirectory(int showFolder) void CFolderItem::GetDataFromDatabase(const TCHAR *szNotFound)
{
char szSettingName[256];
- strcpy_s(szSettingName, SIZEOF(szSettingName), m_szSection);
- strcat_s(szSettingName, SIZEOF(szSettingName), m_szName);
+ strcpy_s(szSettingName, _countof(szSettingName), m_szSection);
+ strcat_s(szSettingName, _countof(szSettingName), m_szName);
ptrT tszValue(db_get_tsa(NULL, ModuleName, szSettingName));
SetFormat(tszValue != NULL ? tszValue : szNotFound);
diff --git a/plugins/Folders/src/services.cpp b/plugins/Folders/src/services.cpp index dfd24f6b59..80fd22c6b2 100644 --- a/plugins/Folders/src/services.cpp +++ b/plugins/Folders/src/services.cpp @@ -79,15 +79,15 @@ INT_PTR GetPathService(WPARAM wParam, LPARAM lParam) int InitServices()
{
- CallService(MS_DB_GETPROFILEPATHT, SIZEOF(szCurrentProfilePath), (LPARAM)szCurrentProfilePath);
- CallService(MS_DB_GETPROFILENAMET, SIZEOF(szCurrentProfile), (LPARAM)szCurrentProfile);
+ CallService(MS_DB_GETPROFILEPATHT, _countof(szCurrentProfilePath), (LPARAM)szCurrentProfilePath);
+ CallService(MS_DB_GETPROFILENAMET, _countof(szCurrentProfile), (LPARAM)szCurrentProfile);
TCHAR *pos = _tcsrchr(szCurrentProfile, '.'); if (pos) *pos = 0;
- GetModuleFileName(GetModuleHandleA("mir_app.dll"), szMirandaPath, SIZEOF(szMirandaPath));
+ GetModuleFileName(GetModuleHandleA("mir_app.dll"), szMirandaPath, _countof(szMirandaPath));
pos = _tcsrchr(szMirandaPath, '\\'); if (pos) *pos = 0;
TCHAR *szTemp = Utils_ReplaceVarsT(_T("%miranda_userdata%"));
- mir_sntprintf(szUserDataPath, SIZEOF(szUserDataPath), szTemp);
+ mir_sntprintf(szUserDataPath, _countof(szUserDataPath), szTemp);
mir_free(szTemp);
CreateServiceFunction(MS_FOLDERS_GET_PATH, GetPathService);
|