From eefe0f0d556fbf3d77602d0a99b9134505050756 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 16 Jul 2014 13:43:06 +0000 Subject: in _tcsncpy_s / _tcsncat_s / strncpy_s / strncat_s the second parameter to be omitted if the size of first one is fixed (not to contaminate sources with the excessive code) git-svn-id: http://svn.miranda-ng.org/main/trunk@9829 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/utils/path.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/modules/utils') diff --git a/src/modules/utils/path.cpp b/src/modules/utils/path.cpp index 2a4bcaa530..0bd1e79383 100644 --- a/src/modules/utils/path.cpp +++ b/src/modules/utils/path.cpp @@ -178,7 +178,7 @@ static __forceinline char *GetPathVarX(char *, int code) switch(code) { case 1: if (hAvatarFolder != NULL) - _tcsncpy_s(szFullPath, SIZEOF(szFullPath), tszAvatarRoot, _TRUNCATE); + _tcsncpy_s(szFullPath, tszAvatarRoot, _TRUNCATE); else mir_sntprintf(szFullPath, SIZEOF(szFullPath), _T("%s\\%s\\AvatarCache"), g_profileDir, g_shortProfileName); break; @@ -262,7 +262,7 @@ static __forceinline TCHAR *GetPathVarX(TCHAR *, int code) switch(code) { case 1: if (hAvatarFolder != NULL) - _tcsncpy_s(szFullPath, SIZEOF(szFullPath), tszAvatarRoot, _TRUNCATE); + _tcsncpy_s(szFullPath, tszAvatarRoot, _TRUNCATE); else mir_sntprintf(szFullPath, SIZEOF(szFullPath), _T("%s\\%s\\AvatarCache"), g_profileDir, g_shortProfileName); break; @@ -434,7 +434,7 @@ static int OnFoldersChanged(WPARAM, LPARAM) TCHAR tmpVar[MAX_PATH]; if (!FoldersGetCustomPathT(hAvatarFolder, tmpVar, SIZEOF(tmpVar), tszAvatarRoot)) - _tcsncpy_s(tszAvatarRoot, SIZEOF(tszAvatarRoot), tmpVar, SIZEOF(tmpVar)); + _tcsncpy_s(tszAvatarRoot, tmpVar, _TRUNCATE); return 0; } @@ -444,7 +444,7 @@ void InitPathVar() if (hAvatarFolder = FoldersRegisterCustomPathT( LPGEN("Avatars"), LPGEN("Avatars root folder"), tszAvatarRoot)) { TCHAR tmpVar[MAX_PATH]; if (!FoldersGetCustomPathT(hAvatarFolder, tmpVar, SIZEOF(tmpVar), tszAvatarRoot)) - _tcsncpy_s(tszAvatarRoot, SIZEOF(tszAvatarRoot), tmpVar, SIZEOF(tmpVar)); + _tcsncpy_s(tszAvatarRoot, tmpVar, _TRUNCATE); HookEvent(ME_FOLDERS_PATH_CHANGED, OnFoldersChanged); } } -- cgit v1.2.3