diff options
author | George Hazan <george.hazan@gmail.com> | 2014-11-30 18:51:36 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-11-30 18:51:36 +0000 |
commit | 688f55ba998c19304a29727c910504903f4cc49a (patch) | |
tree | 69121ebb6d02bcf9e670428b11813087fc7f1640 /plugins/PackUpdater | |
parent | 4f0e30cdf56fbafdf955bbe8b93930bab9e39bd0 (diff) |
lstr* replacements
git-svn-id: http://svn.miranda-ng.org/main/trunk@11176 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/PackUpdater')
-rw-r--r-- | plugins/PackUpdater/Src/Notifications.cpp | 18 | ||||
-rw-r--r-- | plugins/PackUpdater/Src/PackUpdater.cpp | 2 | ||||
-rw-r--r-- | plugins/PackUpdater/Src/Utils.cpp | 18 |
3 files changed, 19 insertions, 19 deletions
diff --git a/plugins/PackUpdater/Src/Notifications.cpp b/plugins/PackUpdater/Src/Notifications.cpp index 4944abfeb8..081cae06b8 100644 --- a/plugins/PackUpdater/Src/Notifications.cpp +++ b/plugins/PackUpdater/Src/Notifications.cpp @@ -115,8 +115,8 @@ VOID show_popup(HWND hDlg, LPCTSTR Title, LPCTSTR Text, int Number, int ActType) pd.cbSize = sizeof(pd);
pd.lchContact = NULL; //(HANDLE)wParam;
pd.lchIcon = LoadSkinnedIcon(PopupsList[Number].Icon);
- lstrcpyn(pd.lptzText, Text, SIZEOF(pd.lptzText));
- lstrcpyn(pd.lptzContactName, Title, SIZEOF(pd.lptzContactName));
+ mir_tstrncpy(pd.lptzText, Text, SIZEOF(pd.lptzText));
+ mir_tstrncpy(pd.lptzContactName, Title, SIZEOF(pd.lptzContactName));
switch (MyOptions.DefColors) {
case byCOLOR_WINDOWS:
pd.colorBack = GetSysColor(COLOR_BTNFACE);
@@ -179,7 +179,7 @@ static void __stdcall CreateDownloadDialog(void*) if ( ServiceExists(MS_POPUP_ADDPOPUPT) && db_get_b(NULL, "Popup", "ModuleIsEnabled", 1) && db_get_b(NULL,MODNAME, "Popups3", DEFAULT_POPUP_ENABLED))
hDlgDld = CreateDialog(hInst, MAKEINTRESOURCE(IDD_POPUPDUMMI), NULL, DlgDownloadPop);
else if (db_get_b(NULL,MODNAME, "Popups3M", DEFAULT_MESSAGE_ENABLED)) {
- lstrcpyn(tszDialogMsg, Text, SIZEOF(tszDialogMsg));
+ mir_tstrncpy(tszDialogMsg, Text, SIZEOF(tszDialogMsg));
hDlgDld = CreateDialog(hInst, MAKEINTRESOURCE(IDD_DOWNLOAD), NULL, DlgDownload);
}
}
@@ -369,16 +369,16 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam CreateDirectory(tszFileDest, NULL);
break;
default:
- lstrcpyn(tszFileDest, tszRoot, SIZEOF(tszFileDest));
+ mir_tstrncpy(tszFileDest, tszRoot, SIZEOF(tszFileDest));
break;
}
mir_sntprintf(tszBuff, SIZEOF(tszBuff), _T("%s\\Backups"), tszRoot);
CreateDirectory(tszBuff, NULL);
- lstrcpyn(tszFileName, todo[i].File.tszDiskPath, SIZEOF(tszFileName));
+ mir_tstrncpy(tszFileName, todo[i].File.tszDiskPath, SIZEOF(tszFileName));
mir_sntprintf(todo[i].File.tszDiskPath, SIZEOF(todo[i].File.tszDiskPath), _T("%s\\%s"), tszFileDest, tszFileName);
UpdatesCount++;
- tszExt = &todo[i].File.tszDownloadURL[lstrlen(todo[i].File.tszDownloadURL)-5];
+ tszExt = &todo[i].File.tszDownloadURL[mir_tstrlen(todo[i].File.tszDownloadURL)-5];
if (lstrcmp(tszExt, _T(".html")) == 0) {
char* szUrl = mir_t2a(todo[i].File.tszDownloadURL);
CallService(MS_UTILS_OPENURL, TRUE, (LPARAM)szUrl);
@@ -399,7 +399,7 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam continue;
}
}
- lstrcpyn(todo[i].tszCurVer, todo[i].tszNewVer, SIZEOF(todo[i].tszCurVer));
+ mir_tstrncpy(todo[i].tszCurVer, todo[i].tszNewVer, SIZEOF(todo[i].tszCurVer));
mir_snprintf(szKey, SIZEOF(szKey), "File_%d_CurrentVersion", todo[i].FileNum);
db_set_ts(NULL, MODNAME, szKey, todo[i].tszCurVer);
arFileType.push_back(todo[i].FileType);
@@ -413,9 +413,9 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam }
if (UpdatesCount > 1 && lstrcmp(arExt[0].c_str(), _T(".html")) != 0)
- lstrcpyn(tszBuff, TranslateT("Downloads complete. Start updating? All your data will be saved and Miranda NG will be closed."), SIZEOF(tszBuff));
+ mir_tstrncpy(tszBuff, TranslateT("Downloads complete. Start updating? All your data will be saved and Miranda NG will be closed."), SIZEOF(tszBuff));
else if (UpdatesCount == 1 && lstrcmp(arExt[0].c_str(), _T(".html")) != 0)
- lstrcpyn(tszBuff, TranslateT("Download complete. Start updating? All your data will be saved and Miranda NG will be closed."), SIZEOF(tszBuff));
+ mir_tstrncpy(tszBuff, TranslateT("Download complete. Start updating? All your data will be saved and Miranda NG will be closed."), SIZEOF(tszBuff));
if (UpdatesCount > 0 && lstrcmp(arExt[0].c_str(), _T(".html")) != 0) {
INT rc = -1;
Title = TranslateT("Pack Updater");
diff --git a/plugins/PackUpdater/Src/PackUpdater.cpp b/plugins/PackUpdater/Src/PackUpdater.cpp index ed5213062e..ab5e8d63ca 100644 --- a/plugins/PackUpdater/Src/PackUpdater.cpp +++ b/plugins/PackUpdater/Src/PackUpdater.cpp @@ -55,7 +55,7 @@ extern "C" __declspec(dllexport) int Load(void) mir_getLP(&pluginInfoEx);
TCHAR* tszFolder = Utils_ReplaceVarsT(_T("%miranda_userdata%\\"DEFAULT_UPDATES_FOLDER));
- lstrcpyn(tszRoot, tszFolder, SIZEOF(tszRoot));
+ mir_tstrncpy(tszRoot, tszFolder, SIZEOF(tszRoot));
hPackUpdaterFolder = FoldersRegisterCustomPathT(MODULEA, LPGEN("Pack Updater"), MIRANDA_USERDATAT _T("\\")DEFAULT_UPDATES_FOLDER);
if (hPackUpdaterFolder)
diff --git a/plugins/PackUpdater/Src/Utils.cpp b/plugins/PackUpdater/Src/Utils.cpp index 49d13a9f6d..7a92f49655 100644 --- a/plugins/PackUpdater/Src/Utils.cpp +++ b/plugins/PackUpdater/Src/Utils.cpp @@ -211,10 +211,10 @@ static void CheckUpdates(void *) }
// Download version info
pFileUrl = (FILEURL *)mir_alloc(sizeof(*pFileUrl));
- lstrcpyn(pFileUrl->tszDownloadURL, dbVar.ptszVal, SIZEOF(pFileUrl->tszDownloadURL));
+ mir_tstrncpy(pFileUrl->tszDownloadURL, dbVar.ptszVal, SIZEOF(pFileUrl->tszDownloadURL));
mir_sntprintf(tszBuff, SIZEOF(tszBuff), _T("%s\\tmp.ini"), tszRoot);
- lstrcpyn(pFileUrl->tszDiskPath, tszBuff, SIZEOF(pFileUrl->tszDiskPath));
- lstrcpyn(tszTmpIni, tszBuff, SIZEOF(tszTmpIni));
+ mir_tstrncpy(pFileUrl->tszDiskPath, tszBuff, SIZEOF(pFileUrl->tszDiskPath));
+ mir_tstrncpy(tszTmpIni, tszBuff, SIZEOF(tszTmpIni));
Title = TranslateT("Pack Updater");
Text = TranslateT("Downloading version info...");
DlgDownloadProc();
@@ -232,18 +232,18 @@ static void CheckUpdates(void *) db_get_ts(NULL, MODNAME, szKey, &dbVar);
if (lstrcmp(dbVar.ptszVal, NULL) == 0) {
db_free(&dbVar);
- lstrcpyn(FileInfo.tszCurVer, _T(""), SIZEOF(FileInfo.tszCurVer));
+ mir_tstrncpy(FileInfo.tszCurVer, _T(""), SIZEOF(FileInfo.tszCurVer));
}
- else lstrcpyn(FileInfo.tszCurVer, dbVar.ptszVal, SIZEOF(FileInfo.tszCurVer));
+ else mir_tstrncpy(FileInfo.tszCurVer, dbVar.ptszVal, SIZEOF(FileInfo.tszCurVer));
dbVar.ptszVal = NULL;
mir_snprintf(szKey, SIZEOF(szKey), "File_%d_LastVersion", CurrentFile + 1);
db_get_ts(NULL, MODNAME, szKey, &dbVar);
if (lstrcmp(dbVar.ptszVal, NULL) == 0) {
db_free(&dbVar);
- lstrcpyn(FileInfo.tszLastVer, _T(""), SIZEOF(FileInfo.tszLastVer));
+ mir_tstrncpy(FileInfo.tszLastVer, _T(""), SIZEOF(FileInfo.tszLastVer));
}
- else lstrcpyn(FileInfo.tszLastVer, dbVar.ptszVal, SIZEOF(FileInfo.tszLastVer));
+ else mir_tstrncpy(FileInfo.tszLastVer, dbVar.ptszVal, SIZEOF(FileInfo.tszLastVer));
Files.push_back(FileInfo);
@@ -267,7 +267,7 @@ static void CheckUpdates(void *) MessageBox(NULL, Text, Title, MB_ICONINFORMATION);
continue;
} // end check update name
- lstrcpyn(Files[CurrentFile].File.tszDiskPath, tszBuff, SIZEOF(Files[CurrentFile].File.tszDiskPath));
+ mir_tstrncpy(Files[CurrentFile].File.tszDiskPath, tszBuff, SIZEOF(Files[CurrentFile].File.tszDiskPath));
GetPrivateProfileString(tszFileInfo, _T("InfoURL"), _T(""), Files[CurrentFile].tszInfoURL, SIZEOF(Files[CurrentFile].tszInfoURL), tszTmpIni);
Files[CurrentFile].FileType = GetPrivateProfileInt(tszFileInfo, _T("FileType"), 0, tszTmpIni);
Files[CurrentFile].Force = GetPrivateProfileInt(tszFileInfo, _T("Force"), 0, tszTmpIni);
@@ -335,7 +335,7 @@ static void CheckUpdates(void *) if (Files[CurrentFile].Force || Exists(tszFilePathDest))
UpdateFiles.push_back(Files[CurrentFile]);
// Save last version
- lstrcpyn(Files[CurrentFile].tszLastVer, Files[CurrentFile].tszNewVer, SIZEOF(Files[CurrentFile].tszLastVer));
+ mir_tstrncpy(Files[CurrentFile].tszLastVer, Files[CurrentFile].tszNewVer, SIZEOF(Files[CurrentFile].tszLastVer));
mir_snprintf(szKey, SIZEOF(szKey), "File_%d_LastVersion", CurrentFile + 1);
db_set_ts(NULL, MODNAME, szKey, Files[CurrentFile].tszLastVer);
|