From 7e315d1103af9248583483da99e96ca339bf2d20 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 11 Apr 2015 15:20:17 +0000 Subject: unsafe string operations replaced with safe wherever possible git-svn-id: http://svn.miranda-ng.org/main/trunk@12768 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/database/database.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/modules/database/database.cpp') diff --git a/src/modules/database/database.cpp b/src/modules/database/database.cpp index c39a7eb434..f16bc48058 100644 --- a/src/modules/database/database.cpp +++ b/src/modules/database/database.cpp @@ -135,18 +135,18 @@ static void getDefaultProfile(TCHAR *szProfile, size_t cch) static void loadProfileByShortName(const TCHAR* src, TCHAR *szProfile, size_t cch) { TCHAR buf[MAX_PATH]; - _tcsncpy(buf, src, SIZEOF(buf)); + _tcsncpy_s(buf, src, _TRUNCATE); TCHAR *p = _tcsrchr(buf, '\\'); if (p) ++p; else p = buf; if (!isValidProfileName(buf) && *p) _tcscat(buf, _T(".dat")); TCHAR profileName[MAX_PATH], newProfileDir[MAX_PATH]; - _tcscpy(profileName, p); + _tcsncpy_s(profileName, p, _TRUNCATE); if (!isValidProfileName(profileName) && *p) _tcscat(profileName, _T(".dat")); - _tcscpy(profileName, p); + _tcsncpy_s(profileName, p, _TRUNCATE); p = _tcsrchr(profileName, '.'); if (p) *p = 0; mir_sntprintf(newProfileDir, cch, _T("%s\\%s\\"), g_profileDir, profileName); @@ -184,7 +184,7 @@ static void moveProfileDirProfiles(TCHAR *profiledir, BOOL isRootDir = TRUE) { TCHAR pfd[MAX_PATH]; if (isRootDir) - _tcsncpy(pfd, VARST(_T("%miranda_path%\\*.dat")), SIZEOF(pfd)); + _tcsncpy_s(pfd, VARST(_T("%miranda_path%\\*.dat")), _TRUNCATE); else mir_sntprintf(pfd, SIZEOF(pfd), _T("%s\\*.dat"), profiledir); -- cgit v1.2.3