summaryrefslogtreecommitdiff
path: root/plugins/StatusPlugins
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2013-07-25 20:15:05 +0000
committerKirill Volinsky <mataes2007@gmail.com>2013-07-25 20:15:05 +0000
commit9d32b9cd791fb5f51dad17567152c70a8511a500 (patch)
treefd7aa3250ed409e720f26c341c0a5d736ed8083c /plugins/StatusPlugins
parent125a25c86eed41352d45eb8fb6f994f65700c3ec (diff)
replace sprintf to mir_snprintf (part 6)
git-svn-id: http://svn.miranda-ng.org/main/trunk@5485 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/StatusPlugins')
-rw-r--r--plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp12
-rw-r--r--plugins/StatusPlugins/KeepStatus/options.cpp2
-rw-r--r--plugins/StatusPlugins/StartupStatus/options.cpp4
-rw-r--r--plugins/StatusPlugins/StartupStatus/profiles.cpp8
-rw-r--r--plugins/StatusPlugins/StartupStatus/startupstatus.cpp6
-rw-r--r--plugins/StatusPlugins/StartupStatus/toolbars.cpp4
-rw-r--r--plugins/StatusPlugins/confirmdialog.cpp4
7 files changed, 20 insertions, 20 deletions
diff --git a/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp b/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp
index f08ed86d13..1bd878db57 100644
--- a/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp
+++ b/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp
@@ -153,13 +153,13 @@ void LoadOptions( OBJLIST<TAAAProtoSetting>& loadSettings, BOOL override)
int LoadAutoAwaySetting(TAAAProtoSetting& autoAwaySetting, char* protoName)
{
char setting[128];
- _snprintf(setting, sizeof(setting), "%s_OptionFlags", protoName);
+ mir_snprintf(setting, sizeof(setting), "%s_OptionFlags", protoName);
autoAwaySetting.optionFlags = db_get_b(NULL,MODULENAME,setting,FLAG_LV2ONINACTIVE|FLAG_RESET);
- _snprintf(setting, sizeof(setting), "%s_AwayTime", protoName);
+ mir_snprintf(setting, sizeof(setting), "%s_AwayTime", protoName);
autoAwaySetting.awayTime = db_get_w(NULL,MODULENAME,setting,SETTING_AWAYTIME_DEFAULT);
- _snprintf(setting, sizeof(setting), "%s_NATime", protoName);
+ mir_snprintf(setting, sizeof(setting), "%s_NATime", protoName);
autoAwaySetting.naTime = db_get_w(NULL,MODULENAME,setting,SETTING_NATIME_DEFAULT);
- _snprintf(setting, sizeof(setting), "%s_StatusFlags", protoName);
+ mir_snprintf(setting, sizeof(setting), "%s_StatusFlags", protoName);
autoAwaySetting.statusFlags = db_get_w(NULL,MODULENAME,setting, StatusModeToProtoFlag(ID_STATUS_ONLINE)|StatusModeToProtoFlag(ID_STATUS_FREECHAT));
int flags;
@@ -167,9 +167,9 @@ int LoadAutoAwaySetting(TAAAProtoSetting& autoAwaySetting, char* protoName)
flags = 0xFFFFFF;
else
flags = CallProtoService(protoName, PS_GETCAPS,PFLAGNUM_2,0)&~CallProtoService(protoName, PS_GETCAPS, (WPARAM)PFLAGNUM_5, 0);
- _snprintf(setting, sizeof(setting), "%s_Lv1Status", protoName);
+ mir_snprintf(setting, sizeof(setting), "%s_Lv1Status", protoName);
autoAwaySetting.lv1Status = db_get_w(NULL, MODULENAME, setting, (flags&StatusModeToProtoFlag(ID_STATUS_AWAY))?ID_STATUS_AWAY:ID_STATUS_OFFLINE);
- _snprintf(setting, sizeof(setting), "%s_Lv2Status", protoName);
+ mir_snprintf(setting, sizeof(setting), "%s_Lv2Status", protoName);
autoAwaySetting.lv2Status = db_get_w(NULL, MODULENAME, setting, (flags&StatusModeToProtoFlag(ID_STATUS_NA))?ID_STATUS_NA:ID_STATUS_OFFLINE);
return 0;
diff --git a/plugins/StatusPlugins/KeepStatus/options.cpp b/plugins/StatusPlugins/KeepStatus/options.cpp
index 6169ddd004..949534c71b 100644
--- a/plugins/StatusPlugins/KeepStatus/options.cpp
+++ b/plugins/StatusPlugins/KeepStatus/options.cpp
@@ -81,7 +81,7 @@ static INT_PTR CALLBACK DlgProcKSBasicOpts(HWND hwndDlg,UINT msg,WPARAM wParam,L
ListView_InsertItem(hList,&lvItem);
char dbSetting[128];
- _snprintf(dbSetting, sizeof(dbSetting), "%s_enabled", protos[i]->szModuleName);
+ mir_snprintf(dbSetting, sizeof(dbSetting), "%s_enabled", protos[i]->szModuleName);
ListView_SetCheckState(hList, lvItem.iItem, db_get_b(NULL, MODULENAME, dbSetting, TRUE));
lvItem.iItem++;
}
diff --git a/plugins/StatusPlugins/StartupStatus/options.cpp b/plugins/StatusPlugins/StartupStatus/options.cpp
index 3e78a0230c..ad68999701 100644
--- a/plugins/StatusPlugins/StartupStatus/options.cpp
+++ b/plugins/StatusPlugins/StartupStatus/options.cpp
@@ -115,7 +115,7 @@ static char* GetCMDL(TSettingsList& protoSettings)
GetModuleFileNameA(NULL, path, MAX_PATH);
char* cmdl = ( char* )malloc(strlen(path) + 4);
- _snprintf(cmdl, strlen(path) + 4, "\"%s\" ", path);
+ mir_snprintf(cmdl, strlen(path) + 4, "\"%s\" ", path);
char* args = GetCMDLArguments(protoSettings);
if ( args ) {
@@ -176,7 +176,7 @@ HRESULT CreateLink(TSettingsList& protoSettings)
if (MyGetSpecialFolderPath(NULL, savePath, 0x10, FALSE))
_tcscat(savePath, _T(SHORTCUT_FILENAME));
else
- _stprintf(savePath, _T(".\\%s"), _T(SHORTCUT_FILENAME));
+ mir_sntprintf(savePath, SIZEOF(savePath), _T(".\\%s"), _T(SHORTCUT_FILENAME));
// Get a pointer to the IShellLink interface.
hres = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, ( void** )&psl);
diff --git a/plugins/StatusPlugins/StartupStatus/profiles.cpp b/plugins/StatusPlugins/StartupStatus/profiles.cpp
index bdd7e78114..f17be2f942 100644
--- a/plugins/StatusPlugins/StartupStatus/profiles.cpp
+++ b/plugins/StatusPlugins/StartupStatus/profiles.cpp
@@ -161,7 +161,7 @@ INT_PTR GetProfileName(WPARAM wParam, LPARAM lParam)
DBVARIANT dbv;
char setting[80];
- _snprintf(setting, sizeof(setting), "%d_%s", profile, SETTING_PROFILENAME);
+ mir_snprintf(setting, sizeof(setting), "%d_%s", profile, SETTING_PROFILENAME);
if ( db_get_ts(NULL, MODULENAME, setting, &dbv))
return -1;
@@ -190,7 +190,7 @@ TCHAR *GetStatusMessage(int profile, char *szProto)
for ( int i=0; i < pceCount; i++ ) {
if ( (pce[i].profile == profile) && (!strcmp(pce[i].szProto, szProto))) {
- _snprintf(dbSetting, sizeof(dbSetting), "%d_%s_%s", profile, szProto, SETTING_PROFILE_STSMSG);
+ mir_snprintf(dbSetting, sizeof(dbSetting), "%d_%s_%s", profile, szProto, SETTING_PROFILE_STSMSG);
if (!db_get_ts(NULL, MODULENAME, dbSetting, &dbv)) { // reload from db
pce[i].msg = ( TCHAR* )realloc(pce[i].msg, sizeof(TCHAR)*(_tcslen(dbv.ptszVal)+1));
if (pce[i].msg != NULL) {
@@ -214,7 +214,7 @@ TCHAR *GetStatusMessage(int profile, char *szProto)
pce[pceCount].profile = profile;
pce[pceCount].szProto = _strdup(szProto);
pce[pceCount].msg = NULL;
- _snprintf(dbSetting, sizeof(dbSetting), "%d_%s_%s", profile, szProto, SETTING_PROFILE_STSMSG);
+ mir_snprintf(dbSetting, sizeof(dbSetting), "%d_%s_%s", profile, szProto, SETTING_PROFILE_STSMSG);
if (!db_get_ts(NULL, MODULENAME, dbSetting, &dbv)) {
pce[pceCount].msg = _tcsdup(dbv.ptszVal);
db_free(&dbv);
@@ -264,7 +264,7 @@ INT_PTR LoadAndSetProfile(WPARAM wParam, LPARAM lParam)
profile = (profile >= 0)?profile:db_get_w(NULL, MODULENAME, SETTING_DEFAULTPROFILE, 0);
char setting[64];
- _snprintf(setting, sizeof(setting), "%d_%s", profile, SETTING_SHOWCONFIRMDIALOG);
+ mir_snprintf(setting, sizeof(setting), "%d_%s", profile, SETTING_SHOWCONFIRMDIALOG);
if (!db_get_b(NULL, MODULENAME, setting, 0))
CallService(MS_CS_SETSTATUSEX,(WPARAM)&profileSettings, 0);
else
diff --git a/plugins/StatusPlugins/StartupStatus/startupstatus.cpp b/plugins/StatusPlugins/StartupStatus/startupstatus.cpp
index f95ec4ce8e..6ed4a8b9f1 100644
--- a/plugins/StatusPlugins/StartupStatus/startupstatus.cpp
+++ b/plugins/StatusPlugins/StartupStatus/startupstatus.cpp
@@ -47,14 +47,14 @@ TSSSetting::TSSSetting( int profile, PROTOACCOUNT* pa )
// load status
char setting[80];
- _snprintf(setting, sizeof(setting), "%d_%s", profile, pa->szModuleName);
+ mir_snprintf(setting, sizeof(setting), "%d_%s", profile, pa->szModuleName);
int iStatus = db_get_w(NULL, MODULENAME, setting, 0);
if ( iStatus < MIN_STATUS || iStatus > MAX_STATUS )
iStatus = DEFAULT_STATUS;
status = iStatus;
// load last status
- _snprintf(setting, sizeof(setting), "%s%s", PREFIX_LAST, szName);
+ mir_snprintf(setting, sizeof(setting), "%s%s", PREFIX_LAST, szName);
iStatus = db_get_w(NULL, MODULENAME, setting, 0);
if ( iStatus < MIN_STATUS || iStatus > MAX_STATUS )
iStatus = DEFAULT_STATUS;
@@ -173,7 +173,7 @@ static void SetLastStatusMessages(TSettingsList& ps)
continue;
char dbSetting[128];
- _snprintf(dbSetting, sizeof(dbSetting), "%s%s", PREFIX_LASTMSG, ps[i].szName);
+ mir_snprintf(dbSetting, sizeof(dbSetting), "%s%s", PREFIX_LASTMSG, ps[i].szName);
DBVARIANT dbv;
if ( ps[i].szMsg == NULL && !db_get_ts(NULL, MODULENAME, dbSetting, &dbv)) {
diff --git a/plugins/StatusPlugins/StartupStatus/toolbars.cpp b/plugins/StatusPlugins/StartupStatus/toolbars.cpp
index a2e53fc395..c88ba01b8c 100644
--- a/plugins/StatusPlugins/StartupStatus/toolbars.cpp
+++ b/plugins/StatusPlugins/StartupStatus/toolbars.cpp
@@ -55,12 +55,12 @@ int CreateTopToolbarButtons(WPARAM wParam, LPARAM lParam)
ttb.pszService = MS_SS_LOADANDSETPROFILE;
for (int i=0; i < profileCount; i++) {
char setting[80];
- _snprintf(setting, sizeof(setting), "%d_%s", i, SETTING_CREATETTBBUTTON);
+ mir_snprintf(setting, sizeof(setting), "%d_%s", i, SETTING_CREATETTBBUTTON);
if (!db_get_b(NULL, MODULENAME, setting, FALSE))
continue;
DBVARIANT dbv;
- _snprintf(setting, sizeof(setting), "%d_%s", i, SETTING_PROFILENAME);
+ mir_snprintf(setting, sizeof(setting), "%d_%s", i, SETTING_PROFILENAME);
if (db_get(NULL, MODULENAME, setting, &dbv))
continue;
diff --git a/plugins/StatusPlugins/confirmdialog.cpp b/plugins/StatusPlugins/confirmdialog.cpp
index 324946eadc..5a0c1f5b41 100644
--- a/plugins/StatusPlugins/confirmdialog.cpp
+++ b/plugins/StatusPlugins/confirmdialog.cpp
@@ -212,7 +212,7 @@ static INT_PTR CALLBACK ConfirmDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARA
// start timer
if (timeOut > 0) {
TCHAR text[32];
- _sntprintf(text, SIZEOF(text), TranslateT("Closing in %d"), timeOut);
+ mir_sntprintf(text, SIZEOF(text), TranslateT("Closing in %d"), timeOut);
SetDlgItemText(hwndDlg, IDC_CLOSE, text);
SetTimer(hwndDlg, TIMER_ID, 1000, NULL);
}
@@ -221,7 +221,7 @@ static INT_PTR CALLBACK ConfirmDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARA
case WM_TIMER:
{
TCHAR text[32];
- _sntprintf(text, SIZEOF(text), TranslateT("Closing in %d"), timeOut-1);
+ mir_sntprintf(text, SIZEOF(text), TranslateT("Closing in %d"), timeOut-1);
SetDlgItemText(hwndDlg, IDC_CLOSE, text);
if (timeOut <= 0) {
KillTimer(hwndDlg, TIMER_ID);