summaryrefslogtreecommitdiff
path: root/plugins/DbChecker
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/DbChecker')
-rw-r--r--plugins/DbChecker/src/selectdb.cpp6
-rw-r--r--plugins/DbChecker/src/worker.cpp6
2 files changed, 7 insertions, 5 deletions
diff --git a/plugins/DbChecker/src/selectdb.cpp b/plugins/DbChecker/src/selectdb.cpp
index dbd7e8baaa..a28d44223a 100644
--- a/plugins/DbChecker/src/selectdb.cpp
+++ b/plugins/DbChecker/src/selectdb.cpp
@@ -119,10 +119,10 @@ static int AddDatabaseToList(HWND hwndList, const TCHAR* filename, TCHAR* dir)
int iNewItem = ListView_InsertItem(hwndList, &lvi);
TCHAR szSize[20];
- _stprintf(szSize, _T("%.2lf MB"), totalSize/1048576.0);
+ mir_sntprintf(szSize, SIZEOF(szSize), _T("%.2lf MB"), totalSize / 1048576.0);
ListView_SetItemText(hwndList, iNewItem, 1, szSize);
if (!broken) {
- _stprintf(szSize, _T("%.2lf MB"), wasted/1048576.0);
+ mir_sntprintf(szSize, SIZEOF(szSize), _T("%.2lf MB"), wasted / 1048576.0);
ListView_SetItemText(hwndList, iNewItem, 2, szSize);
}
return iNewItem;
@@ -143,7 +143,7 @@ void FindAdd(HWND hdlg, TCHAR *szProfileDir, TCHAR *szPrefix)
if ( !(fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) || !_tcscmp(fd.cFileName, _T(".")) || !_tcscmp(fd.cFileName, _T("..")))
continue;
- wsprintf(szFilename, _T("%s\\%s\\%s.dat"), szProfileDir, fd.cFileName, fd.cFileName);
+ mir_sntprintf(szFilename, SIZEOF(szFilename), _T("%s\\%s\\%s.dat"), szProfileDir, fd.cFileName, fd.cFileName);
if ( _taccess(szFilename, 0) == 0)
AddDatabaseToList(GetDlgItem(hdlg, IDC_DBLIST), szFilename, szPrefix);
}
diff --git a/plugins/DbChecker/src/worker.cpp b/plugins/DbChecker/src/worker.cpp
index b6e598b39e..7bd1d692b7 100644
--- a/plugins/DbChecker/src/worker.cpp
+++ b/plugins/DbChecker/src/worker.cpp
@@ -53,8 +53,10 @@ static void Finalize(time_t& ts)
dbPath[0] = 0;
}
for (int i = 1;;i++) {
- if (i == 1) wsprintf(opts.backupFilename,TranslateT("%s\\Backup of %s"),dbPath,dbFile);
- else wsprintf(opts.backupFilename,TranslateT("%s\\Backup (%d) of %s"),dbPath,i,dbFile);
+ if (i == 1)
+ mir_sntprintf(opts.backupFilename, SIZEOF(opts.backupFilename), TranslateT("%s\\Backup of %s"), dbPath, dbFile);
+ else
+ mir_sntprintf(opts.backupFilename, SIZEOF(opts.backupFilename), TranslateT("%s\\Backup (%d) of %s"), dbPath, i, dbFile);
if (_taccess(opts.backupFilename,0) == -1) break;
}