From 4c814798c7bc7f6a0f92c21b027b26290622aa2f Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 19 Jun 2015 19:35:42 +0000 Subject: SIZEOF replaced with more secure analog - _countof git-svn-id: http://svn.miranda-ng.org/main/trunk@14270 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/FTPFileYM/src/job_packer.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'plugins/FTPFileYM/src/job_packer.cpp') diff --git a/plugins/FTPFileYM/src/job_packer.cpp b/plugins/FTPFileYM/src/job_packer.cpp index 11fe8c22fe..13b3b80844 100644 --- a/plugins/FTPFileYM/src/job_packer.cpp +++ b/plugins/FTPFileYM/src/job_packer.cpp @@ -55,9 +55,9 @@ void PackerJob::getZipFilePath() if (stzFileName[0] == '\0') mir_tstrcpy(stzFileName, _T("archive")); - GetTempPath(SIZEOF(buff), buff); + GetTempPath(_countof(buff), buff); - mir_sntprintf(this->stzFilePath, SIZEOF(this->stzFilePath), _T("%s%s.zip"), buff, stzFileName); + mir_sntprintf(this->stzFilePath, _countof(this->stzFilePath), _T("%s%s.zip"), buff, stzFileName); mir_tstrcpy(this->stzFileName, Utils::getFileNameFromPath(this->stzFilePath)); if (opt.bSetZipName) @@ -254,10 +254,10 @@ void PackerJob::updateStats() this->lastUpdateTick = dwNewTick; double speed = ((double)this->uiReaded / 1024)/(time(NULL) - this->startTS); - mir_sntprintf(this->tab->stzSpeed, SIZEOF(this->tab->stzSpeed), TranslateT("%0.1f kB/s"), speed); + mir_sntprintf(this->tab->stzSpeed, _countof(this->tab->stzSpeed), TranslateT("%0.1f kB/s"), speed); double perc = this->uiFileSize ? ((double)this->uiReaded / this->uiFileSize) * 100 : 0; - mir_sntprintf(this->tab->stzComplet, SIZEOF(this->tab->stzComplet), TranslateT("%0.1f%% (%d kB/%d kB)"), perc, (int)this->uiReaded/1024, (int)this->uiFileSize/1024); + mir_sntprintf(this->tab->stzComplet, _countof(this->tab->stzComplet), TranslateT("%0.1f%% (%d kB/%d kB)"), perc, (int)this->uiReaded/1024, (int)this->uiFileSize/1024); TCHAR buff[256]; long s = (this->uiFileSize - this->uiReaded) / (long)(speed * 1024); @@ -268,7 +268,7 @@ void PackerJob::updateStats() if (d > 0) mir_sntprintf(buff, _T("%dd %02d:%02d:%02d"), d, h, m, s); else mir_sntprintf(buff, _T("%02d:%02d:%02d"), h, m, s); - mir_sntprintf(this->tab->stzRemain, SIZEOF(this->tab->stzRemain), TranslateT("%s (%d kB/%d kB)"), buff, (this->uiFileSize - this->uiReaded)/1024, this->uiFileSize/1024); + mir_sntprintf(this->tab->stzRemain, _countof(this->tab->stzRemain), TranslateT("%s (%d kB/%d kB)"), buff, (this->uiFileSize - this->uiReaded)/1024, this->uiFileSize/1024); this->refreshTab(false); } @@ -338,7 +338,7 @@ void PackerJob::closeAllTabs() void PackerJob::createToolTip() { TCHAR *server = mir_a2t(this->ftp->szServer); - mir_sntprintf(uDlg->stzToolTipText, SIZEOF(uDlg->stzToolTipText), + mir_sntprintf(uDlg->stzToolTipText, _countof(uDlg->stzToolTipText), TranslateT("Status: %s\r\nFile: %s\r\nServer: %s"), this->getStatusString(), this->stzFileName, -- cgit v1.2.3