From 4c814798c7bc7f6a0f92c21b027b26290622aa2f Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 19 Jun 2015 19:35:42 +0000 Subject: SIZEOF replaced with more secure analog - _countof git-svn-id: http://svn.miranda-ng.org/main/trunk@14270 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/AvatarHistory/src/AvatarHistory.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'plugins/AvatarHistory/src/AvatarHistory.cpp') diff --git a/plugins/AvatarHistory/src/AvatarHistory.cpp b/plugins/AvatarHistory/src/AvatarHistory.cpp index ff105f96d1..04b88b5942 100644 --- a/plugins/AvatarHistory/src/AvatarHistory.cpp +++ b/plugins/AvatarHistory/src/AvatarHistory.cpp @@ -77,7 +77,7 @@ static INT_PTR GetCachedAvatar(WPARAM wParam, LPARAM lParam) TCHAR hash[128]; _tcsncpy_s(hash, (TCHAR*)lParam, _TRUNCATE); - ConvertToFilename(hash, SIZEOF(hash)); + ConvertToFilename(hash, _countof(hash)); return (INT_PTR)GetCachedAvatar((char*)wParam, hash); } @@ -172,12 +172,12 @@ static int AvatarChanged(WPARAM hContact, LPARAM lParam) TCHAR hash[128]; _tcsncpy_s(hash, avatar->hash, _TRUNCATE); - ConvertToFilename(hash, SIZEOF(hash)); + ConvertToFilename(hash, _countof(hash)); TCHAR *file = GetCachedAvatar(proto, hash); if (file != NULL) { - mir_tstrncpy(history_filename, file, SIZEOF(history_filename)); + mir_tstrncpy(history_filename, file, _countof(history_filename)); mir_free(file); } else { @@ -186,7 +186,7 @@ static int AvatarChanged(WPARAM hContact, LPARAM lParam) else GetProtocolFolder(history_filename, proto); - mir_sntprintf(history_filename, SIZEOF(history_filename), + mir_sntprintf(history_filename, _countof(history_filename), _T("%s\\%s"), history_filename, hash); if (CopyImageFile(avatar->filename, history_filename)) @@ -235,7 +235,7 @@ static int PreShutdown(WPARAM, LPARAM) static int ModulesLoaded(WPARAM, LPARAM) { - mir_sntprintf(basedir, SIZEOF(basedir), _T("%s\\Avatars History"), profilePath); + mir_sntprintf(basedir, _countof(basedir), _T("%s\\Avatars History"), profilePath); hFolder = FoldersRegisterCustomPathT( LPGEN("Avatars"), LPGEN("Avatar History"), PROFILE_PATHT _T("\\") CURRENT_PROFILET _T("\\Avatars History")); -- cgit v1.2.3