summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-06-04 22:12:13 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-06-04 22:12:13 +0000
commitb7c74cd5b22618d544a3f4ae124985d4837e3a22 (patch)
tree468d9610a590685322ad2159a9bd2d9e2ba83f89 /src
parent7de513f180c429859e246d1033d745b394e1fc28 (diff)
new mir_snprintf templates without SIZEOF
git-svn-id: http://svn.miranda-ng.org/main/trunk@14002 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src')
-rw-r--r--src/core/stdaway/src/sendmsg.cpp2
-rw-r--r--src/core/stdchat/src/options.cpp2
-rw-r--r--src/core/stdchat/src/tools.cpp10
-rw-r--r--src/core/stdclist/src/clcfonts.cpp2
-rw-r--r--src/core/stdclist/src/cluiopts.cpp4
-rw-r--r--src/core/stdfile/src/filerecvdlg.cpp8
-rw-r--r--src/core/stdfile/src/filesenddlg.cpp2
-rw-r--r--src/core/stdmsg/src/msgoptions.cpp12
-rw-r--r--src/core/stduserinfo/src/contactinfo.cpp16
-rw-r--r--src/core/stduserinfo/src/stdinfo.cpp14
-rw-r--r--src/mir_core/src/db.cpp2
-rw-r--r--src/mir_core/src/icons.cpp4
-rw-r--r--src/mir_core/src/path.cpp2
-rw-r--r--src/modules/chat/chat_opts.cpp12
-rw-r--r--src/modules/chat/log.cpp12
-rw-r--r--src/modules/clist/clcutils.cpp10
-rw-r--r--src/modules/clist/clistmenus.cpp16
-rw-r--r--src/modules/clist/contacts.cpp4
-rw-r--r--src/modules/clist/genmenuopt.cpp16
-rw-r--r--src/modules/extraicons/extraicons.cpp10
-rw-r--r--src/modules/extraicons/options_ei.cpp22
-rw-r--r--src/modules/findadd/searchresults.cpp8
-rw-r--r--src/modules/fonts/FontOptions.cpp26
-rw-r--r--src/modules/fonts/services.cpp18
-rw-r--r--src/modules/metacontacts/meta_menu.cpp16
-rw-r--r--src/modules/metacontacts/meta_services.cpp12
-rw-r--r--src/modules/metacontacts/meta_utils.cpp22
-rw-r--r--src/modules/netlib/netlibautoproxy.cpp4
-rw-r--r--src/modules/netlib/netlibhttpproxy.cpp4
-rw-r--r--src/modules/netlib/netlibopenconn.cpp4
-rw-r--r--src/modules/netlib/netlibupnp.cpp2
-rw-r--r--src/modules/options/options.cpp4
-rw-r--r--src/modules/protocols/protoaccs.cpp2
-rw-r--r--src/modules/protocols/protoopts.cpp2
-rw-r--r--src/modules/skin/hotkey_opts.cpp8
-rw-r--r--src/modules/skin/hotkeys.cpp10
-rw-r--r--src/modules/utils/enterstring.cpp4
37 files changed, 164 insertions, 164 deletions
diff --git a/src/core/stdaway/src/sendmsg.cpp b/src/core/stdaway/src/sendmsg.cpp
index 4b36e6aa15..5f5246dde4 100644
--- a/src/core/stdaway/src/sendmsg.cpp
+++ b/src/core/stdaway/src/sendmsg.cpp
@@ -75,7 +75,7 @@ static const char *StatusModeToDbSetting(int status, const char *suffix)
case ID_STATUS_IDLE: prefix = "Idl"; break;
default: return NULL;
}
- mir_snprintf(str, SIZEOF(str), "%s%s", prefix, suffix);
+ mir_snprintf(str, "%s%s", prefix, suffix);
return str;
}
diff --git a/src/core/stdchat/src/options.cpp b/src/core/stdchat/src/options.cpp
index 8a5536ec24..84b1fc6fb4 100644
--- a/src/core/stdchat/src/options.cpp
+++ b/src/core/stdchat/src/options.cpp
@@ -309,7 +309,7 @@ void AddIcons(void)
HICON LoadIconEx(char* pszIcoLibName, BOOL big)
{
char szTemp[256];
- mir_snprintf(szTemp, SIZEOF(szTemp), "chat_%s", pszIcoLibName);
+ mir_snprintf(szTemp, "chat_%s", pszIcoLibName);
return Skin_GetIcon(szTemp, big);
}
diff --git a/src/core/stdchat/src/tools.cpp b/src/core/stdchat/src/tools.cpp
index b886edf0d5..284499ef98 100644
--- a/src/core/stdchat/src/tools.cpp
+++ b/src/core/stdchat/src/tools.cpp
@@ -28,16 +28,16 @@ bool LoadMessageFont(LOGFONT *lf, COLORREF *colour)
int i = 8; // MSGFONTID_MESSAGEAREA
if (colour) {
- mir_snprintf(str, SIZEOF(str), "SRMFont%dCol", i);
+ mir_snprintf(str, "SRMFont%dCol", i);
*colour = db_get_dw(NULL, "SRMM", str, 0);
}
if (lf) {
- mir_snprintf(str, SIZEOF(str), "SRMFont%dSize", i);
+ mir_snprintf(str, "SRMFont%dSize", i);
lf->lfHeight = (char)db_get_b(NULL, "SRMM", str, -12);
lf->lfWidth = 0;
lf->lfEscapement = 0;
lf->lfOrientation = 0;
- mir_snprintf(str, SIZEOF(str), "SRMFont%dSty", i);
+ mir_snprintf(str, "SRMFont%dSty", i);
int style = db_get_b(NULL, "SRMM", str, 0);
lf->lfWeight = style & DBFONTF_BOLD ? FW_BOLD : FW_NORMAL;
lf->lfItalic = style & DBFONTF_ITALIC ? 1 : 0;
@@ -47,7 +47,7 @@ bool LoadMessageFont(LOGFONT *lf, COLORREF *colour)
lf->lfClipPrecision = CLIP_DEFAULT_PRECIS;
lf->lfQuality = DEFAULT_QUALITY;
lf->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
- mir_snprintf(str, SIZEOF(str), "SRMFont%d", i);
+ mir_snprintf(str, "SRMFont%d", i);
DBVARIANT dbv;
if (db_get_ts(NULL, "SRMM", str, &dbv))
@@ -56,7 +56,7 @@ bool LoadMessageFont(LOGFONT *lf, COLORREF *colour)
mir_tstrncpy(lf->lfFaceName, dbv.ptszVal, SIZEOF(lf->lfFaceName));
db_free(&dbv);
}
- mir_snprintf(str, SIZEOF(str), "SRMFont%dSet", i);
+ mir_snprintf(str, "SRMFont%dSet", i);
lf->lfCharSet = db_get_b(NULL, "SRMM", str, DEFAULT_CHARSET);
}
return true;
diff --git a/src/core/stdclist/src/clcfonts.cpp b/src/core/stdclist/src/clcfonts.cpp
index 02ae7b298e..873fb00d56 100644
--- a/src/core/stdclist/src/clcfonts.cpp
+++ b/src/core/stdclist/src/clcfonts.cpp
@@ -73,7 +73,7 @@ void RegisterCListFonts()
_tcsncpy(fontid.name, clistFontDescr[i].tszName, SIZEOF(fontid.name));
char idstr[10];
- mir_snprintf(idstr, SIZEOF(idstr), "Font%d", i);
+ mir_snprintf(idstr, "Font%d", i);
strncpy(fontid.prefix, idstr, SIZEOF(fontid.prefix));
fontid.order = i;
FontRegisterT(&fontid);
diff --git a/src/core/stdclist/src/cluiopts.cpp b/src/core/stdclist/src/cluiopts.cpp
index 5a755bec3c..50b947abf1 100644
--- a/src/core/stdclist/src/cluiopts.cpp
+++ b/src/core/stdclist/src/cluiopts.cpp
@@ -140,9 +140,9 @@ static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
case WM_HSCROLL:
{
char str[10];
- mir_snprintf(str, SIZEOF(str), "%d%%", 100 * SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_GETPOS, 0, 0) / 255);
+ mir_snprintf(str, "%d%%", 100 * SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_GETPOS, 0, 0) / 255);
SetDlgItemTextA(hwndDlg, IDC_INACTIVEPERC, str);
- mir_snprintf(str, SIZEOF(str), "%d%%", 100 * SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_GETPOS, 0, 0) / 255);
+ mir_snprintf(str, "%d%%", 100 * SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_GETPOS, 0, 0) / 255);
SetDlgItemTextA(hwndDlg, IDC_ACTIVEPERC, str);
}
if (wParam != 0x12345678)
diff --git a/src/core/stdfile/src/filerecvdlg.cpp b/src/core/stdfile/src/filerecvdlg.cpp
index d49fd5f3db..a092b1449f 100644
--- a/src/core/stdfile/src/filerecvdlg.cpp
+++ b/src/core/stdfile/src/filerecvdlg.cpp
@@ -221,7 +221,7 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
for (int i = 0; i < MAX_MRU_DIRS; i++) {
char idstr[32];
- mir_snprintf(idstr, SIZEOF(idstr), "MruDir%d", i);
+ mir_snprintf(idstr, "MruDir%d", i);
DBVARIANT dbv;
if (db_get_ts(NULL, "SRFile", idstr, &dbv))
@@ -276,7 +276,7 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
break;
case CNFT_DWORD:
hasName = 1;
- mir_snprintf(buf, SIZEOF(buf), "%u", ci.dVal);
+ mir_snprintf(buf, "%u", ci.dVal);
break;
}
}
@@ -348,9 +348,9 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
int i;
DBVARIANT dbv;
for (i = MAX_MRU_DIRS-2;i>=0;i--) {
- mir_snprintf(idstr, SIZEOF(idstr), "MruDir%d", i);
+ mir_snprintf(idstr, "MruDir%d", i);
if (db_get_ts(NULL, "SRFile", idstr, &dbv)) continue;
- mir_snprintf(idstr, SIZEOF(idstr), "MruDir%d", i+1);
+ mir_snprintf(idstr, "MruDir%d", i+1);
db_set_ts(NULL, "SRFile", idstr, dbv.ptszVal);
db_free(&dbv);
}
diff --git a/src/core/stdfile/src/filesenddlg.cpp b/src/core/stdfile/src/filesenddlg.cpp
index bb4128b9dd..5516373588 100644
--- a/src/core/stdfile/src/filesenddlg.cpp
+++ b/src/core/stdfile/src/filesenddlg.cpp
@@ -256,7 +256,7 @@ INT_PTR CALLBACK DlgProcSendFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
break;
case CNFT_DWORD:
hasName = 1;
- mir_snprintf(buf, SIZEOF(buf), "%u", ci.dVal);
+ mir_snprintf(buf, "%u", ci.dVal);
break;
}
}
diff --git a/src/core/stdmsg/src/msgoptions.cpp b/src/core/stdmsg/src/msgoptions.cpp
index f7e1ddeb2a..d2a22249e3 100644
--- a/src/core/stdmsg/src/msgoptions.cpp
+++ b/src/core/stdmsg/src/msgoptions.cpp
@@ -59,16 +59,16 @@ bool LoadMsgDlgFont(int i, LOGFONT* lf, COLORREF * colour)
char str[32];
if (colour) {
- mir_snprintf(str, SIZEOF(str), "SRMFont%dCol", i);
+ mir_snprintf(str, "SRMFont%dCol", i);
*colour = db_get_dw(NULL, SRMMMOD, str, fontOptionsList[i].defColour);
}
if (lf) {
- mir_snprintf(str, SIZEOF(str), "SRMFont%dSize", i);
+ mir_snprintf(str, "SRMFont%dSize", i);
lf->lfHeight = (char)db_get_b(NULL, SRMMMOD, str, fontOptionsList[i].defSize);
lf->lfWidth = 0;
lf->lfEscapement = 0;
lf->lfOrientation = 0;
- mir_snprintf(str, SIZEOF(str), "SRMFont%dSty", i);
+ mir_snprintf(str, "SRMFont%dSty", i);
int style = db_get_b(NULL, SRMMMOD, str, fontOptionsList[i].defStyle);
lf->lfWeight = style & DBFONTF_BOLD ? FW_BOLD : FW_NORMAL;
lf->lfItalic = style & DBFONTF_ITALIC ? 1 : 0;
@@ -78,7 +78,7 @@ bool LoadMsgDlgFont(int i, LOGFONT* lf, COLORREF * colour)
lf->lfClipPrecision = CLIP_DEFAULT_PRECIS;
lf->lfQuality = DEFAULT_QUALITY;
lf->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
- mir_snprintf(str, SIZEOF(str), "SRMFont%d", i);
+ mir_snprintf(str, "SRMFont%d", i);
DBVARIANT dbv;
if (db_get_ts(NULL, SRMMMOD, str, &dbv))
@@ -87,7 +87,7 @@ bool LoadMsgDlgFont(int i, LOGFONT* lf, COLORREF * colour)
mir_tstrncpy(lf->lfFaceName, dbv.ptszVal, SIZEOF(lf->lfFaceName));
db_free(&dbv);
}
- mir_snprintf(str, SIZEOF(str), "SRMFont%dSet", i);
+ mir_snprintf(str, "SRMFont%dSet", i);
lf->lfCharSet = db_get_b(NULL, SRMMMOD, str, MsgDlgGetFontDefaultCharset(lf->lfFaceName));
}
return true;
@@ -103,7 +103,7 @@ void RegisterSRMMFonts(void)
strncpy_s(fontid.dbSettingsGroup, SRMMMOD, _TRUNCATE);
_tcsncpy_s(fontid.group, LPGENT("Message log"), _TRUNCATE);
_tcsncpy_s(fontid.name, fontOptionsList[i].szDescr, _TRUNCATE);
- mir_snprintf(idstr, SIZEOF(idstr), "SRMFont%d", i);
+ mir_snprintf(idstr, "SRMFont%d", i);
strncpy_s(fontid.prefix, idstr, _TRUNCATE);
fontid.order = i;
diff --git a/src/core/stduserinfo/src/contactinfo.cpp b/src/core/stduserinfo/src/contactinfo.cpp
index 301371a4ef..b06a8c795d 100644
--- a/src/core/stduserinfo/src/contactinfo.cpp
+++ b/src/core/stduserinfo/src/contactinfo.cpp
@@ -277,7 +277,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
lvi.pszText = TranslateT("Primary");
}
else {
- mir_snprintf(idstr, SIZEOF(idstr), "e-mail%d", i);
+ mir_snprintf(idstr, "e-mail%d", i);
if (db_get_ts(hContact, szProto, idstr, &dbv))
break;
@@ -292,7 +292,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
lvi.iSubItem = 0;
for (i=0;;i++) {
lvi.lParam = i;
- mir_snprintf(idstr, SIZEOF(idstr), "Mye-mail%d", i);
+ mir_snprintf(idstr, "Mye-mail%d", i);
if (db_get_ts(hContact, "UserInfo", idstr, &dbv))
break;
lvi.pszText = idstr2;
@@ -353,7 +353,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
lvi.iSubItem = 0;
for (i=0;; i++) {
lvi.lParam = i;
- mir_snprintf(idstr, SIZEOF(idstr), "MyPhone%d", i);
+ mir_snprintf(idstr, "MyPhone%d", i);
if (db_get_ts(hContact, "UserInfo", idstr, &dbv))
break;
lvi.pszText = idstr2;
@@ -464,7 +464,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
if (IDOK != DialogBoxParam(hInst, MAKEINTRESOURCE(nm->hdr.idFrom == IDC_PHONES?IDD_ADDPHONE:IDD_ADDEMAIL), hwndDlg, nm->hdr.idFrom == IDC_PHONES?EditUserPhoneDlgProc:EditUserEmailDlgProc, (LPARAM)szNewData))
break;
for (int i=0;; i++) {
- mir_snprintf(idstr, SIZEOF(idstr), szIdTemplate, i);
+ mir_snprintf(idstr, szIdTemplate, i);
if (db_get_s(hContact, "UserInfo", idstr, &dbv)) break;
db_free(&dbv);
}
@@ -477,13 +477,13 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
char idstr[33];
DBVARIANT dbv;
for (i = lvi.lParam;;i++) {
- mir_snprintf(idstr, SIZEOF(idstr), szIdTemplate, i+1);
+ mir_snprintf(idstr, szIdTemplate, i+1);
if (db_get_s(hContact, "UserInfo", idstr, &dbv)) break;
- mir_snprintf(idstr, SIZEOF(idstr), szIdTemplate, i);
+ mir_snprintf(idstr, szIdTemplate, i);
db_set_s(hContact, "UserInfo", idstr, dbv.pszVal);
db_free(&dbv);
}
- mir_snprintf(idstr, SIZEOF(idstr), szIdTemplate, i);
+ mir_snprintf(idstr, szIdTemplate, i);
db_unset(hContact, "UserInfo", idstr);
SendMessage(hwndDlg, M_REMAKELISTS, 0, 0);
}
@@ -491,7 +491,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
//edit
char szText[256], idstr[33];
DBVARIANT dbv;
- mir_snprintf(idstr, SIZEOF(idstr), szIdTemplate, lvi.lParam);
+ mir_snprintf(idstr, szIdTemplate, lvi.lParam);
if (db_get_s(hContact, "UserInfo", idstr, &dbv)) break;
mir_strncpy(szText, dbv.pszVal, SIZEOF(szText));
db_free(&dbv);
diff --git a/src/core/stduserinfo/src/stdinfo.cpp b/src/core/stduserinfo/src/stdinfo.cpp
index 3b6e387dd0..197d24440c 100644
--- a/src/core/stduserinfo/src/stdinfo.cpp
+++ b/src/core/stduserinfo/src/stdinfo.cpp
@@ -97,7 +97,7 @@ static void SetValue(HWND hwndDlg, int idCtrl, MCONTACT hContact, char *szModule
if (dbv.cVal == -100) unspecified = 1;
else {
pstr = str;
- mir_snprintf(str, SIZEOF(str), dbv.cVal ? "UTC%+d:%02d" : "UTC", -dbv.cVal / 2, (dbv.cVal & 1) * 30);
+ mir_snprintf(str, dbv.cVal ? "UTC%+d:%02d" : "UTC", -dbv.cVal / 2, (dbv.cVal & 1) * 30);
}
}
else {
@@ -406,11 +406,11 @@ static INT_PTR CALLBACK BackgroundDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
lvi.iSubItem = 0;
lvi.iItem = 0;
for (i=0;;i++) {
- mir_snprintf(idstr, SIZEOF(idstr), "Past%d", i);
+ mir_snprintf(idstr, "Past%d", i);
if ((proto_service && Proto_GetContactInfoSetting(hContact, szProto, szProto, idstr, &dbv, DBVT_TCHAR)) ||
( !proto_service && db_get_ts(hContact, szProto, idstr, &dbv)))
break;
- mir_snprintf(idstr, SIZEOF(idstr), "Past%dText", i);
+ mir_snprintf(idstr, "Past%dText", i);
if (db_get_ts(hContact, szProto, idstr, &dbvText))
{if (proto_service) Proto_FreeInfoVariant(&dbv); else db_free(&dbv); break;}
lvi.pszText = dbv.ptszVal;
@@ -425,11 +425,11 @@ static INT_PTR CALLBACK BackgroundDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
}
for (i=0;;i++) {
- mir_snprintf(idstr, SIZEOF(idstr), "Affiliation%d", i);
+ mir_snprintf(idstr, "Affiliation%d", i);
if ((proto_service && Proto_GetContactInfoSetting(hContact, szProto, szProto, idstr, &dbv, DBVT_TCHAR)) ||
( !proto_service && db_get_ts(hContact, szProto, idstr, &dbv)))
break;
- mir_snprintf(idstr, SIZEOF(idstr), "Affiliation%dText", i);
+ mir_snprintf(idstr, "Affiliation%dText", i);
if (db_get_ts(hContact, szProto, idstr, &dbvText))
{if (proto_service) Proto_FreeInfoVariant(&dbv); else db_free(&dbv); break;}
lvi.pszText = dbv.ptszVal;
@@ -451,11 +451,11 @@ static INT_PTR CALLBACK BackgroundDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
lvi.iSubItem = 0;
lvi.iItem = 0;
for (i=0;;i++) {
- mir_snprintf(idstr, SIZEOF(idstr), "Interest%dCat", i);
+ mir_snprintf(idstr, "Interest%dCat", i);
if ((proto_service && Proto_GetContactInfoSetting(hContact, szProto, szProto, idstr, &dbv, DBVT_TCHAR)) ||
( !proto_service && db_get_ts(hContact, szProto, idstr, &dbv)))
break;
- mir_snprintf(idstr, SIZEOF(idstr), "Interest%dText", i);
+ mir_snprintf(idstr, "Interest%dText", i);
if (db_get_ts(hContact, szProto, idstr, &dbvText))
{if (proto_service) Proto_FreeInfoVariant(&dbv); else db_free(&dbv); break;}
lvi.pszText = dbv.ptszVal;
diff --git a/src/mir_core/src/db.cpp b/src/mir_core/src/db.cpp
index 22e6b3e8df..6fd3aa39af 100644
--- a/src/mir_core/src/db.cpp
+++ b/src/mir_core/src/db.cpp
@@ -364,6 +364,6 @@ MIR_CORE_DLL(BOOL) db_set_resident(const char *szModule, const char *szService,
return FALSE;
char str[MAXMODULELABELLENGTH * 2];
- mir_snprintf(str, SIZEOF(str), "%s/%s", szModule, szService);
+ mir_snprintf(str, "%s/%s", szModule, szService);
return currDb->SetSettingResident(bEnable, str);
}
diff --git a/src/mir_core/src/icons.cpp b/src/mir_core/src/icons.cpp
index 92b0580ffa..806f17d775 100644
--- a/src/mir_core/src/icons.cpp
+++ b/src/mir_core/src/icons.cpp
@@ -39,7 +39,7 @@ MIR_CORE_DLL(void) Icon_Register(HINSTANCE hInst, const char *szSection, IconIte
for (unsigned i = 0; i < iCount; i++) {
char szSetting[100];
if (prefix) {
- mir_snprintf(szSetting, SIZEOF(szSetting), "%s_%s", prefix, pIcons[i].szName);
+ mir_snprintf(szSetting, "%s_%s", prefix, pIcons[i].szName);
sid.pszName = szSetting;
}
else sid.pszName = pIcons[i].szName;
@@ -64,7 +64,7 @@ MIR_CORE_DLL(void) Icon_RegisterT(HINSTANCE hInst, const TCHAR *szSection, IconI
for (unsigned i = 0; i < iCount; i++) {
char szSetting[100];
if (prefix) {
- mir_snprintf(szSetting, SIZEOF(szSetting), "%s_%s", prefix, pIcons[i].szName);
+ mir_snprintf(szSetting, "%s_%s", prefix, pIcons[i].szName);
sid.pszName = szSetting;
}
else sid.pszName = pIcons[i].szName;
diff --git a/src/mir_core/src/path.cpp b/src/mir_core/src/path.cpp
index 520f19b5a4..cd2b25e94d 100644
--- a/src/mir_core/src/path.cpp
+++ b/src/mir_core/src/path.cpp
@@ -77,7 +77,7 @@ MIR_CORE_DLL(int) PathToAbsolute(const char *pSrc, char *pOut, const char *base)
if (pSrc[0] == '\\')
pSrc++;
- mir_snprintf(buf, SIZEOF(buf), "%s%s", base, pSrc);
+ mir_snprintf(buf, "%s%s", base, pSrc);
return GetFullPathNameA(buf, SIZEOF(buf), pOut, NULL);
}
diff --git a/src/modules/chat/chat_opts.cpp b/src/modules/chat/chat_opts.cpp
index 5a2497b21a..dd889280c2 100644
--- a/src/modules/chat/chat_opts.cpp
+++ b/src/modules/chat/chat_opts.cpp
@@ -97,28 +97,28 @@ void LoadMsgDlgFont(int i, LOGFONT *lf, COLORREF *colour)
FontOptionsList &FO = fontOptionsList[i];
if (colour) {
- mir_snprintf(str, SIZEOF(str), "Font%dCol", i);
+ mir_snprintf(str, "Font%dCol", i);
*colour = db_get_dw(NULL, CHATFONT_MODULE, str, FO.defColour);
}
if (lf) {
- mir_snprintf(str, SIZEOF(str), "Font%dSize", i);
+ mir_snprintf(str, "Font%dSize", i);
lf->lfHeight = (char)db_get_b(NULL, CHATFONT_MODULE, str, FO.defSize);
lf->lfWidth = 0;
lf->lfEscapement = 0;
lf->lfOrientation = 0;
- mir_snprintf(str, SIZEOF(str), "Font%dSty", i);
+ mir_snprintf(str, "Font%dSty", i);
style = db_get_b(NULL, CHATFONT_MODULE, str, FO.defStyle);
lf->lfWeight = style & FONTF_BOLD ? FW_BOLD : FW_NORMAL;
lf->lfItalic = style & FONTF_ITALIC ? 1 : 0;
lf->lfUnderline = 0;
lf->lfStrikeOut = 0;
- mir_snprintf(str, SIZEOF(str), "Font%dSet", i);
+ mir_snprintf(str, "Font%dSet", i);
lf->lfCharSet = db_get_b(NULL, CHATFONT_MODULE, str, FO.defCharset);
lf->lfOutPrecision = OUT_DEFAULT_PRECIS;
lf->lfClipPrecision = CLIP_DEFAULT_PRECIS;
lf->lfQuality = DEFAULT_QUALITY;
lf->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
- mir_snprintf(str, SIZEOF(str), "Font%d", i);
+ mir_snprintf(str, "Font%d", i);
ptrT tszFace(db_get_tsa(NULL, CHATFONT_MODULE, str));
if (tszFace == NULL)
@@ -185,7 +185,7 @@ void RegisterFonts(void)
HICON LoadIconEx(char* pszIcoLibName, BOOL big)
{
char szTemp[256];
- mir_snprintf(szTemp, SIZEOF(szTemp), "chat_%s", pszIcoLibName);
+ mir_snprintf(szTemp, "chat_%s", pszIcoLibName);
return Skin_GetIcon(szTemp, big);
}
diff --git a/src/modules/chat/log.cpp b/src/modules/chat/log.cpp
index 9fc6d5b20a..59c37ff1c1 100644
--- a/src/modules/chat/log.cpp
+++ b/src/modules/chat/log.cpp
@@ -159,7 +159,7 @@ static int Log_AppendRTF(LOGSTREAMDATA *streamData, BOOL simpleMode, char *&buff
col = _ttoi(szTemp3);
col += (OPTIONS_FONTCOUNT + 1);
- mir_snprintf(szTemp, SIZEOF(szTemp), (c == 'c') ? "\\cf%u " : "\\highlight%u ", col);
+ mir_snprintf(szTemp, (c == 'c') ? "\\cf%u " : "\\highlight%u ", col);
}
break;
case 'C':
@@ -167,23 +167,23 @@ static int Log_AppendRTF(LOGSTREAMDATA *streamData, BOOL simpleMode, char *&buff
if (!g_Settings->bStripFormat && !streamData->bStripFormat) {
int j = streamData->lin->bIsHighlighted ? 16 : EventToIndex(streamData->lin);
if (*line == 'C')
- mir_snprintf(szTemp, SIZEOF(szTemp), "\\cf%u ", j + 1);
+ mir_snprintf(szTemp, "\\cf%u ", j + 1);
else
- mir_snprintf(szTemp, SIZEOF(szTemp), "\\highlight0 ");
+ mir_snprintf(szTemp, "\\highlight0 ");
}
break;
case 'b':
case 'u':
case 'i':
if (!streamData->bStripFormat)
- mir_snprintf(szTemp, SIZEOF(szTemp), (*line == 'u') ? "\\%cl " : "\\%c ", *line);
+ mir_snprintf(szTemp, (*line == 'u') ? "\\%cl " : "\\%c ", *line);
break;
case 'B':
case 'U':
case 'I':
if (!streamData->bStripFormat) {
- mir_snprintf(szTemp, SIZEOF(szTemp), (*line == 'U') ? "\\%cl0 " : "\\%c0 ", *line);
+ mir_snprintf(szTemp, (*line == 'U') ? "\\%cl0 " : "\\%c0 ", *line);
CharLowerA(szTemp);
}
break;
@@ -191,7 +191,7 @@ static int Log_AppendRTF(LOGSTREAMDATA *streamData, BOOL simpleMode, char *&buff
case 'r':
if (!streamData->bStripFormat) {
int index = EventToIndex(streamData->lin);
- mir_snprintf(szTemp, SIZEOF(szTemp), "%s ", Log_SetStyle(index));
+ mir_snprintf(szTemp, "%s ", Log_SetStyle(index));
}
break;
}
diff --git a/src/modules/clist/clcutils.cpp b/src/modules/clist/clcutils.cpp
index 1eddd43662..74207f06e8 100644
--- a/src/modules/clist/clcutils.cpp
+++ b/src/modules/clist/clcutils.cpp
@@ -688,18 +688,18 @@ void fnGetFontSetting(int i, LOGFONT* lf, COLORREF* colour)
cli.pfnGetDefaultFontSetting(i, lf, colour);
char idstr[20];
- mir_snprintf(idstr, SIZEOF(idstr), "Font%dName", i);
+ mir_snprintf(idstr, "Font%dName", i);
ptrT tszFace(db_get_tsa(NULL, "CLC", idstr));
if (tszFace)
mir_tstrcpy(lf->lfFaceName, tszFace);
- mir_snprintf(idstr, SIZEOF(idstr), "Font%dCol", i);
+ mir_snprintf(idstr, "Font%dCol", i);
*colour = db_get_dw(NULL, "CLC", idstr, *colour);
- mir_snprintf(idstr, SIZEOF(idstr), "Font%dSize", i);
+ mir_snprintf(idstr, "Font%dSize", i);
lf->lfHeight = (char)db_get_b(NULL, "CLC", idstr, lf->lfHeight);
- mir_snprintf(idstr, SIZEOF(idstr), "Font%dSty", i);
+ mir_snprintf(idstr, "Font%dSty", i);
BYTE style = (BYTE)db_get_b(NULL, "CLC", idstr, (lf->lfWeight == FW_NORMAL ? 0 : DBFONTF_BOLD) | (lf->lfItalic ? DBFONTF_ITALIC : 0) | (lf->lfUnderline ? DBFONTF_UNDERLINE : 0));
lf->lfWidth = lf->lfEscapement = lf->lfOrientation = 0;
lf->lfWeight = style & DBFONTF_BOLD ? FW_BOLD : FW_NORMAL;
@@ -707,7 +707,7 @@ void fnGetFontSetting(int i, LOGFONT* lf, COLORREF* colour)
lf->lfUnderline = (style & DBFONTF_UNDERLINE) != 0;
lf->lfStrikeOut = 0;
- mir_snprintf(idstr, SIZEOF(idstr), "Font%dSet", i);
+ mir_snprintf(idstr, "Font%dSet", i);
lf->lfCharSet = db_get_b(NULL, "CLC", idstr, lf->lfCharSet);
lf->lfOutPrecision = OUT_DEFAULT_PRECIS;
lf->lfClipPrecision = CLIP_DEFAULT_PRECIS;
diff --git a/src/modules/clist/clistmenus.cpp b/src/modules/clist/clistmenus.cpp
index f63a86d5c0..b81968aee8 100644
--- a/src/modules/clist/clistmenus.cpp
+++ b/src/modules/clist/clistmenus.cpp
@@ -283,12 +283,12 @@ static INT_PTR AddContactMenuItem(WPARAM, LPARAM lParam)
PMO_IntMenuItem menuHandle = MO_AddNewMenuItem(hContactMenuObject, &tmi);
char buf[256];
if (mi->pszService)
- mir_snprintf(buf, SIZEOF(buf), "%s/%s", (mi->pszContactOwner) ? mi->pszContactOwner : "", (mi->pszService) ? mi->pszService : "");
+ mir_snprintf(buf, "%s/%s", (mi->pszContactOwner) ? mi->pszContactOwner : "", (mi->pszService) ? mi->pszService : "");
else if (mi->ptszName) {
if (tmi.flags & CMIF_UNICODE)
- mir_snprintf(buf, SIZEOF(buf), "%s/NoService/%s", (mi->pszContactOwner) ? mi->pszContactOwner : "", _T2A(mi->ptszName));
+ mir_snprintf(buf, "%s/NoService/%s", (mi->pszContactOwner) ? mi->pszContactOwner : "", _T2A(mi->ptszName));
else
- mir_snprintf(buf, SIZEOF(buf), "%s/NoService/%s", (mi->pszContactOwner) ? mi->pszContactOwner : "", mi->ptszName);
+ mir_snprintf(buf, "%s/NoService/%s", (mi->pszContactOwner) ? mi->pszContactOwner : "", mi->ptszName);
}
else buf[0] = '\0';
if (buf[0]) MO_SetOptionsMenuItem(menuHandle, OPT_MENUITEMSETUNIQNAME, (INT_PTR)buf);
@@ -426,7 +426,7 @@ INT_PTR StatusMenuCheckService(WPARAM wParam, LPARAM)
XStatus = 0;
char buf[255];
- mir_snprintf(buf, SIZEOF(buf), "*XStatus%d", XStatus);
+ mir_snprintf(buf, "*XStatus%d", XStatus);
bool check = wildcmp(smep->svc, buf) != 0;
bool reset = wildcmp(smep->svc, "*XStatus0") != 0;
@@ -902,7 +902,7 @@ void RebuildMenuOrder(void)
cli.menuProtoCount++;
char buf[256];
- mir_snprintf(buf, SIZEOF(buf), "RootProtocolIcon_%s", pa->szModuleName);
+ mir_snprintf(buf, "RootProtocolIcon_%s", pa->szModuleName);
MO_SetOptionsMenuItem(menuHandle, OPT_MENUITEMSETUNIQNAME, (INT_PTR)buf);
DestroyIcon(ic);
@@ -936,7 +936,7 @@ void RebuildMenuOrder(void)
hStatusMenuHandles[i].menuhandle[j] = MO_AddNewMenuItem(hStatusMenuObject, &tmi);
char buf[256];
- mir_snprintf(buf, SIZEOF(buf), "ProtocolIcon_%s_%s", pa->szModuleName, tmi.pszName);
+ mir_snprintf(buf, "ProtocolIcon_%s_%s", pa->szModuleName, tmi.pszName);
MO_SetOptionsMenuItem(hStatusMenuHandles[i].menuhandle[j], OPT_MENUITEMSETUNIQNAME, (INT_PTR)buf);
IcoLib_ReleaseIcon(tmi.hIcon, 0);
@@ -982,7 +982,7 @@ void RebuildMenuOrder(void)
}
char buf[256];
- mir_snprintf(buf, SIZEOF(buf), "Root2ProtocolIcon_%s_%s", pa->szModuleName, tmi.pszName);
+ mir_snprintf(buf, "Root2ProtocolIcon_%s_%s", pa->szModuleName, tmi.pszName);
MO_SetOptionsMenuItem(hStatusMainMenuHandles[j], OPT_MENUITEMSETUNIQNAME, (INT_PTR)buf);
IcoLib_ReleaseIcon(tmi.hIcon, 0);
@@ -1206,7 +1206,7 @@ static INT_PTR AddStatusMenuItem(WPARAM wParam, LPARAM lParam)
char buf[MAX_PATH + 64];
char *p = (pRoot) ? mir_t2a(pRoot->mi.ptszName) : NULL;
- mir_snprintf(buf, SIZEOF(buf), "%s/%s", (p) ? p : "", mi->pszService ? mi->pszService : "");
+ mir_snprintf(buf, "%s/%s", (p) ? p : "", mi->pszService ? mi->pszService : "");
mir_free(p);
MO_SetOptionsMenuItem(menuHandle, OPT_MENUITEMSETUNIQNAME, (INT_PTR)buf);
diff --git a/src/modules/clist/contacts.cpp b/src/modules/clist/contacts.cpp
index 497527bc8d..9995bf219b 100644
--- a/src/modules/clist/contacts.cpp
+++ b/src/modules/clist/contacts.cpp
@@ -350,7 +350,7 @@ static INT_PTR GetContactInfo(WPARAM, LPARAM lParam)
int offset = tzi->Bias + tzi->StandardBias;
char str[80];
- mir_snprintf(str, SIZEOF(str), offset ? "UTC%+d:%02d" : "UTC", offset / -60, abs(offset % 60));
+ mir_snprintf(str, offset ? "UTC%+d:%02d" : "UTC", offset / -60, abs(offset % 60));
ci->pszVal = ci->dwFlag & CNF_UNICODE ? (TCHAR*)mir_a2u(str) : (TCHAR*)mir_strdup(str);
ci->type = CNFT_ASCIIZ;
return 0;
@@ -384,7 +384,7 @@ public:
m_nameOrder(this, IDC_NAMEORDER)
{
m_nameOrder.SetFlags(MTREE_DND);
- m_nameOrder.OnBeginDrag = Callback(this, &CContactOptsDlg::OnBeginDrag);
+ m_nameOrder.OnBeginDrag = Callback(this, &CContactOptsDlg::OnBeginDrag);
}
virtual void OnInitDialog()
diff --git a/src/modules/clist/genmenuopt.cpp b/src/modules/clist/genmenuopt.cpp
index 7a2339ed47..6be6805ab2 100644
--- a/src/modules/clist/genmenuopt.cpp
+++ b/src/modules/clist/genmenuopt.cpp
@@ -170,7 +170,7 @@ class CGenMenuOptionsPage : public CDlgBase
GetMenuItemName(p, menuItemName, sizeof(menuItemName));
{
DBVARIANT dbv;
- mir_snprintf(buf, SIZEOF(buf), "%s_name", menuItemName);
+ mir_snprintf(buf, "%s_name", menuItemName);
if (!db_get_ts(NULL, MenuNameItems, buf, &dbv)) {
PD->name = mir_tstrdup(dbv.ptszVal);
@@ -182,11 +182,11 @@ class CGenMenuOptionsPage : public CDlgBase
PD->pimi = p;
PD->defname = mir_tstrdup(GetMenuItemText(p));
- mir_snprintf(buf, SIZEOF(buf), "%s_visible", menuItemName);
+ mir_snprintf(buf, "%s_visible", menuItemName);
PD->bShow = db_get_b(NULL, MenuNameItems, buf, 1) != 0;
if (bReread) {
- mir_snprintf(buf, SIZEOF(buf), "%s_pos", menuItemName);
+ mir_snprintf(buf, "%s_pos", menuItemName);
PD->pos = db_get_dw(NULL, MenuNameItems, buf, 1);
}
else PD->pos = (PD->pimi) ? PD->pimi->originalPosition : 0;
@@ -323,7 +323,7 @@ public:
int iNewMenuValue = !m_radio1.GetState();
if (iNewMenuValue != iInitMenuValue) {
- db_set_b(NULL, "CList", "MoveProtoMenus", iNewMenuValue);
+ db_set_b(NULL, "CList", "MoveProtoMenus", iNewMenuValue);
RebuildProtoMenus(iNewMenuValue);
iInitMenuValue = iNewMenuValue;
@@ -362,7 +362,7 @@ public:
tvis.item.mask = TVIF_PARAM | TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
m_menuItems.InsertItem(&tvis);
- NotifyChange();
+ NotifyChange();
}
void btnReset_Clicked(CCtrlButton*)
@@ -370,7 +370,7 @@ public:
int MenuObjectID;
if (GetCurrentMenuObjectID(MenuObjectID)) {
BuildTree(MenuObjectID, false);
- NotifyChange();
+ NotifyChange();
}
}
@@ -393,7 +393,7 @@ public:
SaveTree();
RebuildCurrent();
- NotifyChange();
+ NotifyChange();
}
void btnSet_Clicked(CCtrlButton*)
@@ -415,7 +415,7 @@ public:
SaveTree();
RebuildCurrent();
- NotifyChange();
+ NotifyChange();
}
void onMenuObjectChanged(void*)
diff --git a/src/modules/extraicons/extraicons.cpp b/src/modules/extraicons/extraicons.cpp
index 90ac2c35b2..4df022e512 100644
--- a/src/modules/extraicons/extraicons.cpp
+++ b/src/modules/extraicons/extraicons.cpp
@@ -133,16 +133,16 @@ static void LoadGroups(LIST<ExtraIconGroup> &groups)
int count = db_get_w(NULL, MODULE_NAME "Groups", "Count", 0);
for (int i=0; i < count; i++) {
char setting[512];
- mir_snprintf(setting, SIZEOF(setting), "%d_count", i);
+ mir_snprintf(setting, "%d_count", i);
unsigned int items = db_get_w(NULL, MODULE_NAME "Groups", setting, 0);
if (items < 1)
continue;
- mir_snprintf(setting, SIZEOF(setting), "__group_%d", i);
+ mir_snprintf(setting, "__group_%d", i);
ExtraIconGroup *group = new ExtraIconGroup(setting);
for (unsigned int j = 0; j < items; j++) {
- mir_snprintf(setting, SIZEOF(setting), "%d_%d", i, j);
+ mir_snprintf(setting, "%d_%d", i, j);
ptrA szIconName(db_get_sa(NULL, MODULE_NAME "Groups", setting));
if (IsEmpty(szIconName))
continue;
@@ -408,10 +408,10 @@ INT_PTR ExtraIcon_Register(WPARAM wParam, LPARAM lParam)
}
char setting[512];
- mir_snprintf(setting, SIZEOF(setting), "Position_%s", ei->name);
+ mir_snprintf(setting, "Position_%s", ei->name);
extra->setPosition(db_get_w(NULL, MODULE_NAME, setting, 1000));
- mir_snprintf(setting, SIZEOF(setting), "Slot_%s", ei->name);
+ mir_snprintf(setting, "Slot_%s", ei->name);
int slot = db_get_w(NULL, MODULE_NAME, setting, 1);
if (slot == (WORD)-1)
slot = -1;
diff --git a/src/modules/extraicons/options_ei.cpp b/src/modules/extraicons/options_ei.cpp
index 2b51b9e718..28d0bf553d 100644
--- a/src/modules/extraicons/options_ei.cpp
+++ b/src/modules/extraicons/options_ei.cpp
@@ -342,7 +342,7 @@ public:
}
else {
char name[128];
- mir_snprintf(name, SIZEOF(name), "__group_%d", groups.getCount());
+ mir_snprintf(name, "__group_%d", groups.getCount());
ExtraIconGroup *group = new ExtraIconGroup(name);
@@ -365,10 +365,10 @@ public:
BaseExtraIcon *extra = registeredExtraIcons[i];
char setting[512];
- mir_snprintf(setting, SIZEOF(setting), "Position_%s", extra->getName());
+ mir_snprintf(setting, "Position_%s", extra->getName());
db_set_w(NULL, MODULE_NAME, setting, extra->getPosition());
- mir_snprintf(setting, SIZEOF(setting), "Slot_%s", extra->getName());
+ mir_snprintf(setting, "Slot_%s", extra->getName());
db_set_w(NULL, MODULE_NAME, setting, extra->getSlot());
}
@@ -378,13 +378,13 @@ public:
ExtraIconGroup *group = groups[k];
char setting[512];
- mir_snprintf(setting, SIZEOF(setting), "%d_count", k);
+ mir_snprintf(setting, "%d_count", k);
db_set_w(NULL, MODULE_NAME "Groups", setting, (WORD)group->items.getCount());
for (int j = 0; j < group->items.getCount(); j++) {
BaseExtraIcon *extra = group->items[j];
- mir_snprintf(setting, SIZEOF(setting), "%d_%d", k, j);
+ mir_snprintf(setting, "%d_%d", k, j);
db_set_s(NULL, MODULE_NAME "Groups", setting, extra->getName());
}
}
@@ -419,10 +419,10 @@ public:
ImageList_Destroy(m_tree.GetImageList(TVSIL_NORMAL));
}
- virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
- {
- if (msg == WM_NOTIFY) {
- LPNMHDR lpnmhdr = (LPNMHDR)lParam;
+ virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
+ {
+ if (msg == WM_NOTIFY) {
+ LPNMHDR lpnmhdr = (LPNMHDR)lParam;
if (lpnmhdr->idFrom == IDC_EXTRAORDER && lpnmhdr->code == NM_RCLICK) {
HTREEITEM hSelected = m_tree.GetDropHilight();
if (hSelected != NULL && !m_tree.IsSelected(hSelected)) {
@@ -450,8 +450,8 @@ public:
}
}
- return CDlgBase::DlgProc(msg, wParam, lParam);
- }
+ return CDlgBase::DlgProc(msg, wParam, lParam);
+ }
};
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/modules/findadd/searchresults.cpp b/src/modules/findadd/searchresults.cpp
index 9ab089c02b..f1b149740c 100644
--- a/src/modules/findadd/searchresults.cpp
+++ b/src/modules/findadd/searchresults.cpp
@@ -45,9 +45,9 @@ void SaveColumnSizes(HWND hwndResults)
ListView_GetColumnOrderArray(hwndResults, columnCount, columnOrder);
for (int i = 0; i < NUM_COLUMNID; i++) {
char szSetting[32];
- mir_snprintf(szSetting, SIZEOF(szSetting), "ColOrder%d", i);
+ mir_snprintf(szSetting, "ColOrder%d", i);
db_set_b(NULL, "FindAdd", szSetting, (BYTE)columnOrder[i]);
- mir_snprintf(szSetting, SIZEOF(szSetting), "ColWidth%d", i);
+ mir_snprintf(szSetting, "ColWidth%d", i);
db_set_w(NULL, "FindAdd", szSetting, (WORD)ListView_GetColumnWidth(hwndResults, i));
}
db_set_b(NULL, "FindAdd", "SortColumn", (BYTE)dat->iLastColumnSortIndex);
@@ -84,14 +84,14 @@ void LoadColumnSizes(HWND hwndResults, const char *szProto)
else lvc.pszText = _T("ID");
}
else lvc.mask &= ~LVCF_TEXT;
- mir_snprintf(szSetting, SIZEOF(szSetting), "ColWidth%d", i);
+ mir_snprintf(szSetting, "ColWidth%d", i);
lvc.cx = db_get_w(NULL, "FindAdd", szSetting, defaultColumnSizes[i]);
ListView_InsertColumn(hwndResults, i, (LPARAM)&lvc);
if (bNeedsFree)
mir_free(lvc.pszText);
}
- mir_snprintf(szSetting, SIZEOF(szSetting), "ColOrder%d", i);
+ mir_snprintf(szSetting, "ColOrder%d", i);
columnOrder[i] = db_get_b(NULL, "FindAdd", szSetting, -1);
if (columnOrder[i] == -1 || columnOrder[i] >= NUM_COLUMNID)
colOrdersValid = false;
diff --git a/src/modules/fonts/FontOptions.cpp b/src/modules/fonts/FontOptions.cpp
index 6efdc67f7d..a028f0d9cc 100644
--- a/src/modules/fonts/FontOptions.cpp
+++ b/src/modules/fonts/FontOptions.cpp
@@ -147,7 +147,7 @@ static BOOL ExportSettings(HWND hwndDlg, const TCHAR *filename, OBJLIST<FontInte
for (int i = 0; i < flist.getCount(); i++) {
FontInternal& F = flist[i];
- mir_snprintf(buff, SIZEOF(buff), "\n[%s]", F.dbSettingsGroup);
+ mir_snprintf(buff, "\n[%s]", F.dbSettingsGroup);
if (mir_strcmp(buff, header) != 0) {
strncpy(header, buff, SIZEOF(header));
WriteLine(out, buff);
@@ -193,7 +193,7 @@ static BOOL ExportSettings(HWND hwndDlg, const TCHAR *filename, OBJLIST<FontInte
for (int i = 0; i < clist.getCount(); i++) {
ColourInternal& C = clist[i];
- mir_snprintf(buff, SIZEOF(buff), "\n[%s]", C.dbSettingsGroup);
+ mir_snprintf(buff, "\n[%s]", C.dbSettingsGroup);
if (mir_strcmp(buff, header) != 0) {
strncpy_s(header, buff, _TRUNCATE);
WriteLine(out, buff);
@@ -205,7 +205,7 @@ static BOOL ExportSettings(HWND hwndDlg, const TCHAR *filename, OBJLIST<FontInte
for (int i = 0; i < elist.getCount(); i++) {
EffectInternal& E = elist[i];
- mir_snprintf(buff, SIZEOF(buff), "\n[%s]", E.dbSettingsGroup);
+ mir_snprintf(buff, "\n[%s]", E.dbSettingsGroup);
if (mir_strcmp(buff, header) != 0) {
strncpy_s(header, buff, _TRUNCATE);
WriteLine(out, buff);
@@ -504,7 +504,7 @@ static void sttSaveFontData(HWND hwndDlg, FontInternal &F)
char str[128];
if (F.flags & FIDF_APPENDNAME)
- mir_snprintf(str, SIZEOF(str), "%sName", F.prefix);
+ mir_snprintf(str, "%sName", F.prefix);
else
strncpy_s(str, F.prefix, _TRUNCATE);
@@ -514,7 +514,7 @@ static void sttSaveFontData(HWND hwndDlg, FontInternal &F)
db_set_s(NULL, F.dbSettingsGroup, str, buff);
}
- mir_snprintf(str, SIZEOF(str), "%sSize", F.prefix);
+ mir_snprintf(str, "%sSize", F.prefix);
if (F.flags & FIDF_SAVEACTUALHEIGHT) {
SIZE size;
CreateFromFontSettings(&F.value, &lf);
@@ -535,17 +535,17 @@ static void sttSaveFontData(HWND hwndDlg, FontInternal &F)
}
else db_set_b(NULL, F.dbSettingsGroup, str, F.value.size);
- mir_snprintf(str, SIZEOF(str), "%sSty", F.prefix);
+ mir_snprintf(str, "%sSty", F.prefix);
db_set_b(NULL, F.dbSettingsGroup, str, F.value.style);
- mir_snprintf(str, SIZEOF(str), "%sSet", F.prefix);
+ mir_snprintf(str, "%sSet", F.prefix);
db_set_b(NULL, F.dbSettingsGroup, str, F.value.charset);
- mir_snprintf(str, SIZEOF(str), "%sCol", F.prefix);
+ mir_snprintf(str, "%sCol", F.prefix);
db_set_dw(NULL, F.dbSettingsGroup, str, F.value.colour);
if (F.flags & FIDF_NOAS) {
- mir_snprintf(str, SIZEOF(str), "%sAs", F.prefix);
+ mir_snprintf(str, "%sAs", F.prefix);
db_set_w(NULL, F.dbSettingsGroup, str, (WORD)0x00FF);
}
- mir_snprintf(str, SIZEOF(str), "%sFlags", F.prefix);
+ mir_snprintf(str, "%sFlags", F.prefix);
db_set_w(NULL, F.dbSettingsGroup, str, (WORD)F.flags);
}
@@ -1139,13 +1139,13 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam,
for (i = 0; i < effect_id_list_w2.getCount(); i++) {
EffectInternal& E = effect_id_list_w2[i];
- mir_snprintf(str, SIZEOF(str), "%sEffect", E.setting);
+ mir_snprintf(str, "%sEffect", E.setting);
db_set_b(NULL, E.dbSettingsGroup, str, E.value.effectIndex);
- mir_snprintf(str, SIZEOF(str), "%sEffectCol1", E.setting);
+ mir_snprintf(str, "%sEffectCol1", E.setting);
db_set_dw(NULL, E.dbSettingsGroup, str, E.value.baseColour);
- mir_snprintf(str, SIZEOF(str), "%sEffectCol2", E.setting);
+ mir_snprintf(str, "%sEffectCol2", E.setting);
db_set_dw(NULL, E.dbSettingsGroup, str, E.value.secondaryColour);
}
diff --git a/src/modules/fonts/services.cpp b/src/modules/fonts/services.cpp
index b02a4f7c82..77f29e8218 100644
--- a/src/modules/fonts/services.cpp
+++ b/src/modules/fonts/services.cpp
@@ -137,7 +137,7 @@ int GetFontSettingFromDB(char *settings_group, char *prefix, LOGFONT *lf, COLORR
char idstr[256];
if (flags & FIDF_APPENDNAME)
- mir_snprintf(idstr, SIZEOF(idstr), "%sName", prefix);
+ mir_snprintf(idstr, "%sName", prefix);
else
strncpy_s(idstr, prefix, _TRUNCATE);
@@ -149,14 +149,14 @@ int GetFontSettingFromDB(char *settings_group, char *prefix, LOGFONT *lf, COLORR
retval = 1;
if (colour) {
- mir_snprintf(idstr, SIZEOF(idstr), "%sCol", prefix);
+ mir_snprintf(idstr, "%sCol", prefix);
*colour = db_get_dw(NULL, settings_group, idstr, *colour);
}
- mir_snprintf(idstr, SIZEOF(idstr), "%sSize", prefix);
+ mir_snprintf(idstr, "%sSize", prefix);
lf->lfHeight = (char)db_get_b(NULL, settings_group, idstr, lf->lfHeight);
- mir_snprintf(idstr, SIZEOF(idstr), "%sSty", prefix);
+ mir_snprintf(idstr, "%sSty", prefix);
BYTE style = (BYTE)db_get_b(NULL, settings_group, idstr,
(lf->lfWeight == FW_NORMAL ? 0 : DBFONTF_BOLD) | (lf->lfItalic ? DBFONTF_ITALIC : 0) | (lf->lfUnderline ? DBFONTF_UNDERLINE : 0) | lf->lfStrikeOut ? DBFONTF_STRIKEOUT : 0);
@@ -166,7 +166,7 @@ int GetFontSettingFromDB(char *settings_group, char *prefix, LOGFONT *lf, COLORR
lf->lfUnderline = (style & DBFONTF_UNDERLINE) != 0;
lf->lfStrikeOut = (style & DBFONTF_STRIKEOUT) != 0;
- mir_snprintf(idstr, SIZEOF(idstr), "%sSet", prefix);
+ mir_snprintf(idstr, "%sSet", prefix);
lf->lfCharSet = db_get_b(NULL, settings_group, idstr, lf->lfCharSet);
lf->lfOutPrecision = OUT_DEFAULT_PRECIS;
@@ -250,7 +250,7 @@ static int sttRegisterFontWorker(FontIDW *font_id, int hLangpack)
}
char idstr[256];
- mir_snprintf(idstr, SIZEOF(idstr), "%sFlags", font_id->prefix);
+ mir_snprintf(idstr, "%sFlags", font_id->prefix);
db_set_dw(0, font_id->dbSettingsGroup, idstr, font_id->flags);
FontInternal* newItem = new FontInternal;
@@ -413,13 +413,13 @@ void KillModuleColours(int hLangpack)
void UpdateEffectSettings(EffectIDW *effect_id, FONTEFFECT *effectsettings)
{
char str[256];
- mir_snprintf(str, SIZEOF(str), "%sEffect", effect_id->setting);
+ mir_snprintf(str, "%sEffect", effect_id->setting);
effectsettings->effectIndex = db_get_b(NULL, effect_id->dbSettingsGroup, str, effect_id->defeffect.effectIndex);
- mir_snprintf(str, SIZEOF(str), "%sEffectCol1", effect_id->setting);
+ mir_snprintf(str, "%sEffectCol1", effect_id->setting);
effectsettings->baseColour = db_get_dw(NULL, effect_id->dbSettingsGroup, str, effect_id->defeffect.baseColour);
- mir_snprintf(str, SIZEOF(str), "%sEffectCol2", effect_id->setting);
+ mir_snprintf(str, "%sEffectCol2", effect_id->setting);
effectsettings->secondaryColour = db_get_dw(NULL, effect_id->dbSettingsGroup, str, effect_id->defeffect.secondaryColour);
}
diff --git a/src/modules/metacontacts/meta_menu.cpp b/src/modules/metacontacts/meta_menu.cpp
index 9f17f423f5..e2a78aff38 100644
--- a/src/modules/metacontacts/meta_menu.cpp
+++ b/src/modules/metacontacts/meta_menu.cpp
@@ -111,25 +111,25 @@ void Meta_RemoveContactNumber(DBCachedContact *ccMeta, int number, bool bUpdateI
// remove the last one
int id = ccMeta->nSubs - 1;
char buffer[512];
- mir_snprintf(buffer, SIZEOF(buffer), "Handle%d", id);
+ mir_snprintf(buffer, "Handle%d", id);
db_unset(ccMeta->contactID, META_PROTO, buffer);
- mir_snprintf(buffer, SIZEOF(buffer), "Protocol%d", id);
+ mir_snprintf(buffer, "Protocol%d", id);
db_unset(ccMeta->contactID, META_PROTO, buffer);
- mir_snprintf(buffer, SIZEOF(buffer), "Status%d", id);
+ mir_snprintf(buffer, "Status%d", id);
db_unset(ccMeta->contactID, META_PROTO, buffer);
- mir_snprintf(buffer, SIZEOF(buffer), "StatusString%d", id);
+ mir_snprintf(buffer, "StatusString%d", id);
db_unset(ccMeta->contactID, META_PROTO, buffer);
- mir_snprintf(buffer, SIZEOF(buffer), "Login%d", id);
+ mir_snprintf(buffer, "Login%d", id);
db_unset(ccMeta->contactID, META_PROTO, buffer);
- mir_snprintf(buffer, SIZEOF(buffer), "Nick%d", id);
+ mir_snprintf(buffer, "Nick%d", id);
db_unset(ccMeta->contactID, META_PROTO, buffer);
- mir_snprintf(buffer, SIZEOF(buffer), "CListName%d", id);
+ mir_snprintf(buffer, "CListName%d", id);
db_unset(ccMeta->contactID, META_PROTO, buffer);
if (ccSub != NULL) {
@@ -425,7 +425,7 @@ void InitMenus()
mi.pszName = "";
char buffer[512];
- mir_snprintf(buffer, SIZEOF(buffer), "MetaContacts/MenuFunc%d", i);
+ mir_snprintf(buffer, "MetaContacts/MenuFunc%d", i);
mi.pszService = buffer;
mi.position++;
hMenuContact[i] = Menu_AddContactMenuItem(&mi);
diff --git a/src/modules/metacontacts/meta_services.cpp b/src/modules/metacontacts/meta_services.cpp
index 7a7ef09b80..72f60c5f71 100644
--- a/src/modules/metacontacts/meta_services.cpp
+++ b/src/modules/metacontacts/meta_services.cpp
@@ -374,12 +374,12 @@ int Meta_SettingChanged(WPARAM hContact, LPARAM lParam)
}
else if (!mir_strcmp(dcws->szSetting, "Nick") && dcws->value.type != DBVT_DELETED) {
// subcontact nick has changed - update metacontact
- mir_snprintf(buffer, SIZEOF(buffer), "Nick%d", contact_number);
+ mir_snprintf(buffer, "Nick%d", contact_number);
db_set(ccMeta->contactID, META_PROTO, buffer, &dcws->value);
ptrT tszMyhandle(db_get_tsa(hContact, "CList", "MyHandle"));
if (tszMyhandle == NULL) {
- mir_snprintf(buffer, SIZEOF(buffer), "CListName%d", contact_number);
+ mir_snprintf(buffer, "CListName%d", contact_number);
db_set(ccMeta->contactID, META_PROTO, buffer, &dcws->value);
}
@@ -402,7 +402,7 @@ int Meta_SettingChanged(WPARAM hContact, LPARAM lParam)
else if (!mir_strcmp(dcws->szModule, "CList") && !mir_strcmp(dcws->szSetting, "MyHandle")) {
if (dcws->value.type == DBVT_DELETED) {
char *proto = GetContactProto(hContact);
- mir_snprintf(buffer, SIZEOF(buffer), "CListName%d", contact_number);
+ mir_snprintf(buffer, "CListName%d", contact_number);
DBVARIANT dbv;
if (proto && !db_get_ts(hContact, proto, "Nick", &dbv)) {
@@ -413,7 +413,7 @@ int Meta_SettingChanged(WPARAM hContact, LPARAM lParam)
}
else {
// subcontact clist displayname has changed - update metacontact
- mir_snprintf(buffer, SIZEOF(buffer), "CListName%d", contact_number);
+ mir_snprintf(buffer, "CListName%d", contact_number);
db_set(ccMeta->contactID, META_PROTO, buffer, &dcws->value);
}
@@ -423,10 +423,10 @@ int Meta_SettingChanged(WPARAM hContact, LPARAM lParam)
// subcontact changing status
else if (!mir_strcmp(dcws->szSetting, "Status") && dcws->value.type != DBVT_DELETED) {
// update subcontact status setting
- mir_snprintf(buffer, SIZEOF(buffer), "Status%d", contact_number);
+ mir_snprintf(buffer, "Status%d", contact_number);
db_set_w(ccMeta->contactID, META_PROTO, buffer, dcws->value.wVal);
- mir_snprintf(buffer, SIZEOF(buffer), "StatusString%d", contact_number);
+ mir_snprintf(buffer, "StatusString%d", contact_number);
db_set_ts(ccMeta->contactID, META_PROTO, buffer, cli.pfnGetStatusModeDescription(dcws->value.wVal, 0));
// set status to that of most online contact
diff --git a/src/modules/metacontacts/meta_utils.cpp b/src/modules/metacontacts/meta_utils.cpp
index 9bf3aff72e..e58f509fcf 100644
--- a/src/modules/metacontacts/meta_utils.cpp
+++ b/src/modules/metacontacts/meta_utils.cpp
@@ -116,7 +116,7 @@ BOOL Meta_Assign(MCONTACT hSub, MCONTACT hMeta, BOOL set_as_default)
// write the contact's protocol
char buffer[512];
- mir_snprintf(buffer, SIZEOF(buffer), "Protocol%d", ccDest->nSubs);
+ mir_snprintf(buffer, "Protocol%d", ccDest->nSubs);
if (db_set_s(hMeta, META_PROTO, buffer, szProto)) {
MessageBox(0, TranslateT("Could not write contact protocol to metacontact"), TranslateT("Assignment error"), MB_OK | MB_ICONWARNING);
db_free(&dbv);
@@ -124,7 +124,7 @@ BOOL Meta_Assign(MCONTACT hSub, MCONTACT hMeta, BOOL set_as_default)
}
// write the login
- mir_snprintf(buffer, SIZEOF(buffer), "Login%d", ccDest->nSubs);
+ mir_snprintf(buffer, "Login%d", ccDest->nSubs);
if (db_set(hMeta, META_PROTO, buffer, &dbv)) {
MessageBox(0, TranslateT("Could not write unique ID of contact to metacontact"), TranslateT("Assignment error"), MB_OK | MB_ICONWARNING);
db_free(&dbv);
@@ -136,7 +136,7 @@ BOOL Meta_Assign(MCONTACT hSub, MCONTACT hMeta, BOOL set_as_default)
// If we can get the nickname of the subcontact...
if (!db_get(hSub, szProto, "Nick", &dbv)) {
// write the nickname
- mir_snprintf(buffer, SIZEOF(buffer), "Nick%d", ccDest->nSubs);
+ mir_snprintf(buffer, "Nick%d", ccDest->nSubs);
if (db_set(hMeta, META_PROTO, buffer, &dbv)) {
MessageBox(0, TranslateT("Could not write nickname of contact to metacontact"), TranslateT("Assignment error"), MB_OK | MB_ICONWARNING);
db_free(&dbv);
@@ -147,22 +147,22 @@ BOOL Meta_Assign(MCONTACT hSub, MCONTACT hMeta, BOOL set_as_default)
}
// write the display name
- mir_snprintf(buffer, SIZEOF(buffer), "CListName%d", ccDest->nSubs);
+ mir_snprintf(buffer, "CListName%d", ccDest->nSubs);
db_set_ts(hMeta, META_PROTO, buffer, cli.pfnGetContactDisplayName(hSub, 0));
// Get the status
WORD status = db_get_w(hSub, szProto, "Status", ID_STATUS_OFFLINE);
// write the status
- mir_snprintf(buffer, SIZEOF(buffer), "Status%d", ccDest->nSubs);
+ mir_snprintf(buffer, "Status%d", ccDest->nSubs);
db_set_w(hMeta, META_PROTO, buffer, status);
// write the handle
- mir_snprintf(buffer, SIZEOF(buffer), "Handle%d", ccDest->nSubs);
+ mir_snprintf(buffer, "Handle%d", ccDest->nSubs);
db_set_dw(hMeta, META_PROTO, buffer, hSub);
// write status string
- mir_snprintf(buffer, SIZEOF(buffer), "StatusString%d", ccDest->nSubs);
+ mir_snprintf(buffer, "StatusString%d", ccDest->nSubs);
TCHAR *szStatus = cli.pfnGetStatusModeDescription(status, 0);
db_set_ts(hMeta, META_PROTO, buffer, szStatus);
@@ -362,7 +362,7 @@ int Meta_HideLinkedContacts(void)
continue;
// update metacontact's record of status for this contact
- mir_snprintf(buffer, SIZEOF(buffer), "Status%d",contact_number);
+ mir_snprintf(buffer, "Status%d",contact_number);
// prepare to update metacontact record of subcontat status
char *szProto = GetContactProto(hContact);
@@ -372,10 +372,10 @@ int Meta_HideLinkedContacts(void)
// update metacontact's record of nick for this contact
if (szProto && !db_get(hContact, szProto, "Nick", &dbv)) {
- mir_snprintf(buffer, SIZEOF(buffer), "Nick%d",contact_number);
+ mir_snprintf(buffer, "Nick%d",contact_number);
db_set(ccMeta->contactID, META_PROTO, buffer, &dbv);
- mir_snprintf(buffer, SIZEOF(buffer), "CListName%d",contact_number);
+ mir_snprintf(buffer, "CListName%d",contact_number);
if (db_get(hContact, "CList", "MyHandle", &dbv2))
db_set(ccMeta->contactID, META_PROTO, buffer, &dbv);
else {
@@ -387,7 +387,7 @@ int Meta_HideLinkedContacts(void)
}
else {
if (!db_get(hContact, "CList", "MyHandle", &dbv)) {
- mir_snprintf(buffer, SIZEOF(buffer),"CListName%d",contact_number);
+ mir_snprintf(buffer,"CListName%d",contact_number);
db_set(ccMeta->contactID, META_PROTO, buffer, &dbv);
db_free(&dbv);
}
diff --git a/src/modules/netlib/netlibautoproxy.cpp b/src/modules/netlib/netlibautoproxy.cpp
index ddc74b7a6b..f0b8464a2f 100644
--- a/src/modules/netlib/netlibautoproxy.cpp
+++ b/src/modules/netlib/netlibautoproxy.cpp
@@ -169,11 +169,11 @@ bool NetlibGetIeProxyConn(NetlibConnection *nlc, bool forceHttps)
if ((nlc->nloc.flags & (NLOCF_HTTP | NLOCF_HTTPGATEWAY) && nlc->nloc.flags & NLOCF_SSL) ||
nlc->nloc.wPort == 443 || forceHttps)
{
- mir_snprintf(szUrl, SIZEOF(szUrl), "https://%s", nlc->nloc.szHost);
+ mir_snprintf(szUrl, "https://%s", nlc->nloc.szHost);
usingSsl = true;
}
else if (nlc->nloc.flags & (NLOCF_HTTPGATEWAY | NLOCF_HTTP) || nlc->usingHttpGateway)
- mir_snprintf(szUrl, SIZEOF(szUrl), "http://%s", nlc->nloc.szHost);
+ mir_snprintf(szUrl, "http://%s", nlc->nloc.szHost);
else
{
strncpy_s(szUrl, nlc->nloc.szHost, _TRUNCATE);
diff --git a/src/modules/netlib/netlibhttpproxy.cpp b/src/modules/netlib/netlibhttpproxy.cpp
index 0770977c16..892554542d 100644
--- a/src/modules/netlib/netlibhttpproxy.cpp
+++ b/src/modules/netlib/netlibhttpproxy.cpp
@@ -88,7 +88,7 @@ static bool NetlibHttpGatewaySend(NetlibConnection *nlc, RequestType reqType, co
nlhrSend.timeout = -1;
if ((nlc->nlhpi.flags & NLHPIF_USEGETSEQUENCE) && (nlc->nlhpi.szHttpGetUrl != NULL)) {
mir_cslock lck(nlc->csHttpSequenceNums);
- mir_snprintf(szUrl, SIZEOF(szUrl), "%s%u", nlc->nlhpi.szHttpGetUrl, nlc->nlhpi.firstGetSequence++);
+ mir_snprintf(szUrl, "%s%u", nlc->nlhpi.szHttpGetUrl, nlc->nlhpi.firstGetSequence++);
if (nlc->nlhpi.flags & NLHPIF_GETPOSTSAMESEQUENCE)
nlc->nlhpi.firstPostSequence++;
nlhrSend.szUrl = szUrl;
@@ -99,7 +99,7 @@ static bool NetlibHttpGatewaySend(NetlibConnection *nlc, RequestType reqType, co
case reqOldPost:
nlhrSend.requestType = REQUEST_POST;
if ((nlc->nlhpi.flags & NLHPIF_USEPOSTSEQUENCE) && (nlc->nlhpi.szHttpPostUrl != NULL)) {
- mir_snprintf(szUrl, SIZEOF(szUrl), "%s%u", nlc->nlhpi.szHttpPostUrl, nlc->nlhpi.firstPostSequence);
+ mir_snprintf(szUrl, "%s%u", nlc->nlhpi.szHttpPostUrl, nlc->nlhpi.firstPostSequence);
nlhrSend.szUrl = szUrl;
}
else nlhrSend.szUrl = nlc->nlhpi.szHttpPostUrl;
diff --git a/src/modules/netlib/netlibopenconn.cpp b/src/modules/netlib/netlibopenconn.cpp
index 7b9a892782..894899be2f 100644
--- a/src/modules/netlib/netlibopenconn.cpp
+++ b/src/modules/netlib/netlibopenconn.cpp
@@ -302,11 +302,11 @@ static bool NetlibInitHttpsConnection(NetlibConnection *nlc, NetlibUser *nlu, NE
nlhrSend.requestType = REQUEST_CONNECT;
nlhrSend.flags = NLHRF_GENERATEHOST | NLHRF_DUMPPROXY | NLHRF_SMARTAUTHHEADER | NLHRF_HTTP11 | NLHRF_NOPROXY | NLHRF_REDIRECT;
if (nlc->dnsThroughProxy)
- mir_snprintf(szUrl, SIZEOF(szUrl), "%s:%u", nloc->szHost, nloc->wPort);
+ mir_snprintf(szUrl, "%s:%u", nloc->szHost, nloc->wPort);
else {
DWORD ip = DnsLookup(nlu, nloc->szHost);
if (ip == 0) return false;
- mir_snprintf(szUrl, SIZEOF(szUrl), "%s:%u", inet_ntoa(*(PIN_ADDR)&ip), nloc->wPort);
+ mir_snprintf(szUrl, "%s:%u", inet_ntoa(*(PIN_ADDR)&ip), nloc->wPort);
}
nlhrSend.szUrl = szUrl;
diff --git a/src/modules/netlib/netlibupnp.cpp b/src/modules/netlib/netlibupnp.cpp
index 2e3445126f..d3f30498d6 100644
--- a/src/modules/netlib/netlibupnp.cpp
+++ b/src/modules/netlib/netlibupnp.cpp
@@ -517,7 +517,7 @@ static bool getUPnPURLs(char* szUrl, size_t sizeUrl)
strncpy(szCtlUrl, szTemp[0] ? szTemp : szUrl, sizeof(szCtlUrl));
szCtlUrl[sizeof(szCtlUrl) - 1] = 0;
- mir_snprintf(szTemp, SIZEOF(szTemp), search_device, szDev);
+ mir_snprintf(szTemp, search_device, szDev);
txtParseParam(szData, szTemp, "<controlURL>", "</controlURL>", szUrl, sizeUrl);
// URL combining per RFC 2396
diff --git a/src/modules/options/options.cpp b/src/modules/options/options.cpp
index 8b52feb368..0c668e50d2 100644
--- a/src/modules/options/options.cpp
+++ b/src/modules/options/options.cpp
@@ -212,7 +212,7 @@ static void SaveOptionsTreeState(HWND hdlg)
tvi.hItem = TreeView_GetRoot(GetDlgItem(hdlg, IDC_PAGETREE));
while (tvi.hItem != NULL) {
if (SendDlgItemMessageA(hdlg, IDC_PAGETREE, TVM_GETITEMA, 0, (LPARAM)&tvi)) {
- mir_snprintf(buf, SIZEOF(buf), "%s%s", OPTSTATE_PREFIX, str);
+ mir_snprintf(buf, "%s%s", OPTSTATE_PREFIX, str);
db_set_b(NULL, "Options", buf, (BYTE)((tvi.state & TVIS_EXPANDED) ? 1 : 0));
}
tvi.hItem = TreeView_GetNextSibling(GetDlgItem(hdlg, IDC_PAGETREE), tvi.hItem);
@@ -656,7 +656,7 @@ static void RebuildPageTree(HWND hdlg, OptionsDlgData *dat)
while (tvi.hItem != NULL) {
if (SendMessageA(hwndTree, TVM_GETITEMA, 0, (LPARAM)&tvi)) {
char buf[130];
- mir_snprintf(buf, SIZEOF(buf), "%s%s", OPTSTATE_PREFIX, str);
+ mir_snprintf(buf, "%s%s", OPTSTATE_PREFIX, str);
if (!db_get_b(NULL, "Options", buf, 1))
TreeView_Expand(hwndTree, tvi.hItem, TVE_COLLAPSE);
}
diff --git a/src/modules/protocols/protoaccs.cpp b/src/modules/protocols/protoaccs.cpp
index 42e27aba15..1e92cb637c 100644
--- a/src/modules/protocols/protoaccs.cpp
+++ b/src/modules/protocols/protoaccs.cpp
@@ -294,7 +294,7 @@ int LoadAccountsModule(void)
static HANDLE CreateProtoServiceEx(const char* szModule, const char* szService, MIRANDASERVICEOBJ pFunc, void* param)
{
char tmp[100];
- mir_snprintf(tmp, SIZEOF(tmp), "%s%s", szModule, szService);
+ mir_snprintf(tmp, "%s%s", szModule, szService);
return CreateServiceFunctionObj(tmp, pFunc, param);
}
diff --git a/src/modules/protocols/protoopts.cpp b/src/modules/protocols/protoopts.cpp
index 0b54d8e30c..c276a62ca1 100644
--- a/src/modules/protocols/protoopts.cpp
+++ b/src/modules/protocols/protoopts.cpp
@@ -74,7 +74,7 @@ PROTOACCOUNT* Proto_CreateAccount(const char *szModuleName, const char *szBasePr
char buf[100];
int count = 1;
while (true) {
- mir_snprintf(buf, SIZEOF(buf), "%s_%d", szBaseProto, count++);
+ mir_snprintf(buf, "%s_%d", szBaseProto, count++);
if (ptrA(db_get_sa(NULL, buf, "AM_BaseProto")) == NULL)
break;
}
diff --git a/src/modules/skin/hotkey_opts.cpp b/src/modules/skin/hotkey_opts.cpp
index 4c04405e09..4e86d5021b 100644
--- a/src/modules/skin/hotkey_opts.cpp
+++ b/src/modules/skin/hotkey_opts.cpp
@@ -307,7 +307,7 @@ static int CALLBACK sttOptionsSortList(LPARAM lParam1, LPARAM lParam2, LPARAM lP
static void sttOptionsAddHotkey(HWND hwndList, THotkeyItem *item)
{
char buf[256];
- mir_snprintf(buf, SIZEOF(buf), "mir_hotkey_%d_%d", g_pid, g_hkid++);
+ mir_snprintf(buf, "mir_hotkey_%d_%d", g_pid, g_hkid++);
THotkeyItem *newItem = (THotkeyItem *)mir_alloc(sizeof(THotkeyItem));
newItem->pszName = NULL;
@@ -369,7 +369,7 @@ static void sttOptionsSaveItem(THotkeyItem *item)
subItem->Hotkey = subItem->OptHotkey;
subItem->type = subItem->OptType;
- mir_snprintf(buf, SIZEOF(buf), "%s$%d", item->pszName, item->nSubHotkeys);
+ mir_snprintf(buf, "%s$%d", item->pszName, item->nSubHotkeys);
db_set_w(NULL, DBMODULENAME, buf, subItem->Hotkey);
if (subItem->type != HKT_MANUAL)
db_set_b(NULL, DBMODULENAME "Types", buf, (BYTE)subItem->type);
@@ -377,7 +377,7 @@ static void sttOptionsSaveItem(THotkeyItem *item)
++item->nSubHotkeys;
} }
- mir_snprintf(buf, SIZEOF(buf), "%s$count", item->pszName);
+ mir_snprintf(buf, "%s$count", item->pszName);
db_set_dw(NULL, DBMODULENAME, buf, item->nSubHotkeys);
}
@@ -664,7 +664,7 @@ static INT_PTR CALLBACK sttOptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
case WM_CONTEXTMENU:
if (GetWindowLongPtr((HWND)wParam, GWL_ID) == IDC_LV_HOTKEYS) {
HWND hwndList = (HWND)wParam;
- POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
+ POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
LVITEM lvi = {0};
THotkeyItem *item = NULL;
diff --git a/src/modules/skin/hotkeys.cpp b/src/modules/skin/hotkeys.cpp
index 13dfc09ad0..d660ef294a 100644
--- a/src/modules/skin/hotkeys.cpp
+++ b/src/modules/skin/hotkeys.cpp
@@ -178,7 +178,7 @@ static INT_PTR svcHotkeyRegister(WPARAM wParam, LPARAM lParam)
item->lParam = desc->lParam;
char buf[256];
- mir_snprintf(buf, SIZEOF(buf), "mir_hotkey_%d_%d", g_pid, g_hkid++);
+ mir_snprintf(buf, "mir_hotkey_%d_%d", g_pid, g_hkid++);
item->idHotkey = GlobalAddAtomA(buf);
if (item->type == HKT_GLOBAL) {
if (item->Enabled) {
@@ -192,10 +192,10 @@ static INT_PTR svcHotkeyRegister(WPARAM wParam, LPARAM lParam)
if (!item->rootHotkey) {
/* try to load alternatives from db */
int count, i;
- mir_snprintf(buf, SIZEOF(buf), "%s$count", item->pszName);
+ mir_snprintf(buf, "%s$count", item->pszName);
count = (int)db_get_dw(NULL, DBMODULENAME, buf, -1);
for (i=0; i < count; i++) {
- mir_snprintf(buf, SIZEOF(buf), "%s$%d", item->pszName, i);
+ mir_snprintf(buf, "%s$%d", item->pszName, i);
if (!db_get_w(NULL, DBMODULENAME, buf, 0))
continue;
@@ -371,7 +371,7 @@ int LoadSkinHotkeys(void)
for (int i=0; i < SIZEOF(oldSettings); i++) {
char szSetting[ 100 ];
- mir_snprintf(szSetting, SIZEOF(szSetting), "HK%s", oldSettings[i]);
+ mir_snprintf(szSetting, "HK%s", oldSettings[i]);
WORD key;
if ((key = db_get_w(NULL, "Clist", szSetting, 0))) {
@@ -379,7 +379,7 @@ int LoadSkinHotkeys(void)
db_set_w(NULL, DBMODULENAME, newSettings[i], key);
}
- mir_snprintf(szSetting, SIZEOF(szSetting), "HKEn%s", oldSettings[i]);
+ mir_snprintf(szSetting, "HKEn%s", oldSettings[i]);
if ((key = db_get_b(NULL, "Clist", szSetting, 0))) {
db_unset(NULL, "Clist", szSetting);
db_set_b(NULL, DBMODULENAME "Off", newSettings[i], (BYTE)(key == 0));
diff --git a/src/modules/utils/enterstring.cpp b/src/modules/utils/enterstring.cpp
index 156945d14f..84adf3a1e4 100644
--- a/src/modules/utils/enterstring.cpp
+++ b/src/modules/utils/enterstring.cpp
@@ -56,7 +56,7 @@ static void ComboLoadRecentStrings(HWND hwndDlg, EnterStringFormParam *pForm)
{
for (int i = 0; i < pForm->recentCount; i++) {
char setting[MAXMODULELABELLENGTH];
- mir_snprintf(setting, SIZEOF(setting), "%s%d", pForm->szDataPrefix, i);
+ mir_snprintf(setting, "%s%d", pForm->szDataPrefix, i);
ptrT tszRecent(db_get_tsa(NULL, pForm->szModuleName, setting));
if (tszRecent != NULL)
SendDlgItemMessage(hwndDlg, pForm->idcControl, CB_ADDSTRING, 0, tszRecent);
@@ -82,7 +82,7 @@ static void ComboAddRecentString(HWND hwndDlg, EnterStringFormParam *pForm)
id = db_get_b(NULL, pForm->szModuleName, pForm->szDataPrefix, 0);
char setting[MAXMODULELABELLENGTH];
- mir_snprintf(setting, SIZEOF(setting), "%s%d", pForm->szDataPrefix, id);
+ mir_snprintf(setting, "%s%d", pForm->szDataPrefix, id);
db_set_ts(NULL, pForm->szModuleName, setting, string);
db_set_b(NULL, pForm->szModuleName, pForm->szDataPrefix, (id + 1) % pForm->idcControl);
}