summaryrefslogtreecommitdiff
path: root/plugins/Db_autobackups
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Db_autobackups')
-rw-r--r--plugins/Db_autobackups/src/backup.cpp8
-rw-r--r--plugins/Db_autobackups/src/main.cpp2
-rw-r--r--plugins/Db_autobackups/src/options.cpp13
3 files changed, 11 insertions, 12 deletions
diff --git a/plugins/Db_autobackups/src/backup.cpp b/plugins/Db_autobackups/src/backup.cpp
index db914d4a83..3a9a39b7e4 100644
--- a/plugins/Db_autobackups/src/backup.cpp
+++ b/plugins/Db_autobackups/src/backup.cpp
@@ -181,7 +181,7 @@ int RotateBackups(TCHAR *backupfolder, TCHAR *dbname)
if (options.num_backups == 0)
return 0; /* Roration disabled. */
- mir_sntprintf(backupfolderTmp, _countof(backupfolderTmp), _T("%s\\%s*"), backupfolder, dbname);
+ mir_sntprintf(backupfolderTmp, _T("%s\\%s*"), backupfolder, dbname);
hFind = FindFirstFile(backupfolderTmp, &FindFileData);
if (hFind == INVALID_HANDLE_VALUE)
return 0;
@@ -201,7 +201,7 @@ int RotateBackups(TCHAR *backupfolder, TCHAR *dbname)
if (i > 0)
qsort(bf, i, sizeof(backupFile), Comp); /* Sort the list of found files by date in descending order. */
for (; i >= options.num_backups; i --) {
- mir_sntprintf(backupfolderTmp, _countof(backupfolderTmp), _T("%s\\%s"), backupfolder, bf[(i - 1)].Name);
+ mir_sntprintf(backupfolderTmp, _T("%s\\%s"), backupfolder, bf[(i - 1)].Name);
DeleteFile(backupfolderTmp);
}
err_out:
@@ -237,7 +237,7 @@ int Backup(TCHAR *backup_filename)
GetLocalTime(&st);
GetComputerName(buffer, &size);
- mir_sntprintf(dest_file, _countof(dest_file), _T("%s\\%s_%02d.%02d.%02d@%02d-%02d-%02d_%s.%s"), backupfolder, dbname, st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond, buffer, bZip ? _T("zip") : _T("dat"));
+ mir_sntprintf(dest_file, _T("%s\\%s_%02d.%02d.%02d@%02d-%02d-%02d_%s.%s"), backupfolder, dbname, st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond, buffer, bZip ? _T("zip") : _T("dat"));
mir_free(backupfolder);
}
else {
@@ -253,7 +253,7 @@ int Backup(TCHAR *backup_filename)
SetDlgItemText(progress_dialog, IDC_PROGRESSMESSAGE, TranslateT("Copying database file..."));
- mir_sntprintf(source_file, _countof(source_file), _T("%s\\%s"), profilePath, dbname);
+ mir_sntprintf(source_file, _T("%s\\%s"), profilePath, dbname);
TCHAR *pathtmp = Utils_ReplaceVarsT(source_file);
BOOL res = 0;
if (bZip)
diff --git a/plugins/Db_autobackups/src/main.cpp b/plugins/Db_autobackups/src/main.cpp
index 4f143fedb9..5579e9daf4 100644
--- a/plugins/Db_autobackups/src/main.cpp
+++ b/plugins/Db_autobackups/src/main.cpp
@@ -37,7 +37,7 @@ static INT_PTR DBSaveAs(WPARAM, LPARAM)
OPENFILENAME ofn = { 0 };
CallService(MS_DB_GETPROFILENAMET, _countof(fname_buff), (LPARAM)fname_buff);
- mir_sntprintf(tszFilter, _countof(tszFilter), _T("%s (*.dat)%c*.dat%c%s (*.zip)%c*.zip%c%s (*.*)%c*%c"),
+ mir_sntprintf(tszFilter, _T("%s (*.dat)%c*.dat%c%s (*.zip)%c*.zip%c%s (*.*)%c*%c"),
TranslateT("Miranda NG databases"), 0, 0,
TranslateT("Compressed Miranda NG databases"), 0, 0,
TranslateT("All files"), 0, 0);
diff --git a/plugins/Db_autobackups/src/options.cpp b/plugins/Db_autobackups/src/options.cpp
index a9fe7d9abf..59e5ca5306 100644
--- a/plugins/Db_autobackups/src/options.cpp
+++ b/plugins/Db_autobackups/src/options.cpp
@@ -48,13 +48,12 @@ int LoadOptions(void)
if (mir_tstrlen(tmp) >= 2 && tmp[1] == ':')
_tcsncpy_s(options.folder, dbv.ptszVal, _TRUNCATE);
else
- mir_sntprintf(options.folder, _countof(options.folder), _T("%s\\%s"), profilePath, dbv.ptszVal);
+ mir_sntprintf(options.folder, _T("%s\\%s"), profilePath, dbv.ptszVal);
db_free(&dbv);
mir_free(tmp);
}
- else
- mir_sntprintf(options.folder, _countof(options.folder), _T("%s%s"), DIR, SUB_DIR);
+ else mir_sntprintf(options.folder, _T("%s%s"), DIR, SUB_DIR);
}
options.num_backups = db_get_w(0, "AutoBackups", "NumBackups", 3);
@@ -76,7 +75,7 @@ int SaveOptions(void)
db_set_w(0, "AutoBackups", "Period", (WORD)options.period);
db_set_b(0, "AutoBackups", "PeriodType", (BYTE)options.period_type);
- mir_sntprintf(prof_dir, _countof(prof_dir), _T("%s\\"), profilePath);
+ mir_sntprintf(prof_dir, _T("%s\\"), profilePath);
size_t prof_len = mir_tstrlen(prof_dir);
size_t opt_len = mir_tstrlen(options.folder);
@@ -89,7 +88,7 @@ int SaveOptions(void)
TCHAR *tmp = Utils_ReplaceVarsT(options.folder);
if (mir_tstrlen(tmp) < 2 || tmp[1] != ':') {
_tcsncpy_s(prof_dir, options.folder, _TRUNCATE);
- mir_sntprintf(options.folder, _countof(options.folder), _T("%s\\%s"), profilePath, prof_dir);
+ mir_sntprintf(options.folder, _T("%s\\%s"), profilePath, prof_dir);
}
mir_free(tmp);
db_set_w(0, "AutoBackups", "NumBackups", options.num_backups);
@@ -188,7 +187,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
}
else {
TCHAR tszTooltipText[4096];
- mir_sntprintf(tszTooltipText, _countof(tszTooltipText), _T("%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s"),
+ mir_sntprintf(tszTooltipText, _T("%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s"),
_T("%miranda_path%"), TranslateT("path to Miranda root folder"),
_T("%miranda_profilesdir%"), TranslateT("path to folder containing Miranda profiles"),
_T("%miranda_profilename%"), TranslateT("name of current Miranda profile (filename, without extension)"),
@@ -346,7 +345,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
if (mir_tstrlen(tmp) >= 2 && tmp[1] == ':')
_tcsncpy_s(backupfolder, tmp, _TRUNCATE);
else
- mir_sntprintf(backupfolder, _countof(backupfolder), _T("%s\\%s"), profilePath, tmp);
+ mir_sntprintf(backupfolder, _T("%s\\%s"), profilePath, tmp);
mir_free(tmp);
int err = CreateDirectoryTreeT(backupfolder);