diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2013-07-25 20:15:05 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2013-07-25 20:15:05 +0000 |
commit | 9d32b9cd791fb5f51dad17567152c70a8511a500 (patch) | |
tree | fd7aa3250ed409e720f26c341c0a5d736ed8083c /plugins/StatusPlugins/StartupStatus | |
parent | 125a25c86eed41352d45eb8fb6f994f65700c3ec (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/StartupStatus')
4 files changed, 11 insertions, 11 deletions
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;
|