From c370af60855db957c5b200914bf0bde743845528 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 28 Aug 2015 16:22:41 +0000 Subject: mir_sntprintf / mir_snprintf: obsoleted second parameter removed wherever possible git-svn-id: http://svn.miranda-ng.org/main/trunk@15064 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/PackUpdater/Src/Utils.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'plugins/PackUpdater/Src/Utils.cpp') diff --git a/plugins/PackUpdater/Src/Utils.cpp b/plugins/PackUpdater/Src/Utils.cpp index 5c2d660079..5b9351986c 100644 --- a/plugins/PackUpdater/Src/Utils.cpp +++ b/plugins/PackUpdater/Src/Utils.cpp @@ -206,7 +206,7 @@ static void CheckUpdates(void *) // Download version info pFileUrl = (FILEURL *)mir_alloc(sizeof(*pFileUrl)); mir_tstrncpy(pFileUrl->tszDownloadURL, tszDownloadURL, _countof(pFileUrl->tszDownloadURL)); - mir_sntprintf(tszBuff, _countof(tszBuff), _T("%s\\tmp.ini"), tszRoot); + mir_sntprintf(tszBuff, _T("%s\\tmp.ini"), tszRoot); mir_tstrncpy(pFileUrl->tszDiskPath, tszBuff, _countof(pFileUrl->tszDiskPath)); mir_tstrncpy(tszTmpIni, tszBuff, _countof(tszTmpIni)); Title = TranslateT("Pack Updater"); @@ -221,14 +221,14 @@ static void CheckUpdates(void *) for (CurrentFile = 0; CurrentFile < FileCount; CurrentFile++) { FILEINFO FileInfo = { _T(""), _T(""), _T(""), _T(""), _T(""), _T(""), _T(""), { _T(""), _T("") } }; - mir_snprintf(szKey, _countof(szKey), "File_%d_CurrentVersion", CurrentFile + 1); + mir_snprintf(szKey, "File_%d_CurrentVersion", CurrentFile + 1); ptrT tszCurVer(db_get_tsa(NULL, MODNAME, szKey)); if (tszCurVer) mir_tstrncpy(FileInfo.tszCurVer, tszCurVer, _countof(FileInfo.tszCurVer)); else mir_tstrncpy(FileInfo.tszCurVer, _T(""), _countof(FileInfo.tszCurVer)); - mir_snprintf(szKey, _countof(szKey), "File_%d_LastVersion", CurrentFile + 1); + mir_snprintf(szKey, "File_%d_LastVersion", CurrentFile + 1); ptrT tszLastVer(db_get_tsa(NULL, MODNAME, szKey)); if (tszLastVer) mir_tstrncpy(FileInfo.tszLastVer, tszLastVer, _countof(FileInfo.tszLastVer)); @@ -238,7 +238,7 @@ static void CheckUpdates(void *) Files.push_back(FileInfo); // Read version info - mir_sntprintf(tszFileInfo, _countof(tszFileInfo), _T("FileInfo_%d"), CurrentFile + 1); + mir_sntprintf(tszFileInfo, _T("FileInfo_%d"), CurrentFile + 1); GetPrivateProfileString(tszFileInfo, _T("FileVersion"), _T(""), Files[CurrentFile].tszNewVer, _countof(Files[CurrentFile].tszNewVer), tszTmpIni); GetPrivateProfileString(tszFileInfo, _T("Message"), _T(""), Files[CurrentFile].tszMessage, _countof(Files[CurrentFile].tszMessage), tszTmpIni); GetPrivateProfileString(tszFileInfo, _T("DownloadURL"), _T(""), Files[CurrentFile].File.tszDownloadURL, _countof(Files[CurrentFile].File.tszDownloadURL), tszTmpIni); @@ -265,9 +265,9 @@ static void CheckUpdates(void *) if (Files[CurrentFile].FileType == 2) { if (mir_tstrcmp(Files[CurrentFile].tszAdvFolder, _T("")) == 0) - mir_sntprintf(tszBuff, _countof(tszBuff), _T("Plugins\\%s"), Files[CurrentFile].File.tszDiskPath); + mir_sntprintf(tszBuff, _T("Plugins\\%s"), Files[CurrentFile].File.tszDiskPath); else - mir_sntprintf(tszBuff, _countof(tszBuff), _T("Plugins\\%s\\%s"), Files[CurrentFile].tszAdvFolder, Files[CurrentFile].File.tszDiskPath); + mir_sntprintf(tszBuff, _T("Plugins\\%s\\%s"), Files[CurrentFile].tszAdvFolder, Files[CurrentFile].File.tszDiskPath); TCHAR pluginFolderName[MAX_PATH]; PathToAbsoluteT(tszBuff, pluginFolderName); if (!Files[CurrentFile].Force && (IsPluginDisabled(Files[CurrentFile].File.tszDiskPath) || !Exists(pluginFolderName))) //check if plugin disabled or not exists @@ -294,26 +294,26 @@ static void CheckUpdates(void *) case 2: { VARST tszUtilRootPlug(_T("%miranda_path%\\Plugins")); if (mir_tstrcmp(Files[CurrentFile].tszAdvFolder, _T("")) == 0) - mir_sntprintf(tszFilePathDest, _countof(tszFilePathDest), _T("%s\\%s"), tszUtilRootPlug, Files[CurrentFile].File.tszDiskPath); + mir_sntprintf(tszFilePathDest, _T("%s\\%s"), tszUtilRootPlug, Files[CurrentFile].File.tszDiskPath); else - mir_sntprintf(tszFilePathDest, _countof(tszFilePathDest), _T("%s\\%s\\%s"), tszUtilRootPlug, Files[CurrentFile].tszAdvFolder, Files[CurrentFile].File.tszDiskPath); + mir_sntprintf(tszFilePathDest, _T("%s\\%s\\%s"), tszUtilRootPlug, Files[CurrentFile].tszAdvFolder, Files[CurrentFile].File.tszDiskPath); } break; case 3: { VARST tszUtilRootIco(_T("%miranda_path%\\Icons")); if (mir_tstrcmp(Files[CurrentFile].tszAdvFolder, _T("")) == 0) - mir_sntprintf(tszFilePathDest, _countof(tszFilePathDest), _T("%s\\%s"), tszUtilRootIco, Files[CurrentFile].File.tszDiskPath); + mir_sntprintf(tszFilePathDest, _T("%s\\%s"), tszUtilRootIco, Files[CurrentFile].File.tszDiskPath); else - mir_sntprintf(tszFilePathDest, _countof(tszFilePathDest), _T("%s\\%s\\%s"), tszUtilRootIco, Files[CurrentFile].tszAdvFolder, Files[CurrentFile].File.tszDiskPath); + mir_sntprintf(tszFilePathDest, _T("%s\\%s\\%s"), tszUtilRootIco, Files[CurrentFile].tszAdvFolder, Files[CurrentFile].File.tszDiskPath); } break; case 4: case 5: { VARST tszUtilRoot = Utils_ReplaceVarsT(_T("%miranda_path%")); if (mir_tstrcmp(Files[CurrentFile].tszAdvFolder, _T("")) == 0) - mir_sntprintf(tszFilePathDest, _countof(tszFilePathDest), _T("%s\\%s"), tszUtilRoot, Files[CurrentFile].File.tszDiskPath); + mir_sntprintf(tszFilePathDest, _T("%s\\%s"), tszUtilRoot, Files[CurrentFile].File.tszDiskPath); else - mir_sntprintf(tszFilePathDest, _countof(tszFilePathDest), _T("%s\\%s\\%s"), tszUtilRoot, Files[CurrentFile].tszAdvFolder, Files[CurrentFile].File.tszDiskPath); + mir_sntprintf(tszFilePathDest, _T("%s\\%s\\%s"), tszUtilRoot, Files[CurrentFile].tszAdvFolder, Files[CurrentFile].File.tszDiskPath); } break; }//end* switch (Files[CurrentFile].FileType) @@ -322,7 +322,7 @@ static void CheckUpdates(void *) UpdateFiles.push_back(Files[CurrentFile]); // Save last version mir_tstrncpy(Files[CurrentFile].tszLastVer, Files[CurrentFile].tszNewVer, _countof(Files[CurrentFile].tszLastVer)); - mir_snprintf(szKey, _countof(szKey), "File_%d_LastVersion", CurrentFile + 1); + mir_snprintf(szKey, "File_%d_LastVersion", CurrentFile + 1); db_set_ts(NULL, MODNAME, szKey, Files[CurrentFile].tszLastVer); } // end compare versions } //end checking all files in for () -- cgit v1.2.3