diff options
author | George Hazan <george.hazan@gmail.com> | 2015-04-11 15:20:17 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-04-11 15:20:17 +0000 |
commit | 7e315d1103af9248583483da99e96ca339bf2d20 (patch) | |
tree | 6398336a2286278e6857e3205247ba0ed74a2e20 /src/modules/database | |
parent | c391c203e82d635e58561911ac7753c1d1261cc9 (diff) |
unsafe string operations replaced with safe wherever possible
git-svn-id: http://svn.miranda-ng.org/main/trunk@12768 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/database')
-rw-r--r-- | src/modules/database/database.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
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);
|