summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorRozhuk Ivan <rozhuk.im@gmail.com>2014-12-09 00:59:27 +0000
committerRozhuk Ivan <rozhuk.im@gmail.com>2014-12-09 00:59:27 +0000
commit36472b00443e23acf28b0dd26ddc2c2e6216d909 (patch)
treea526bbc6d309e05f1728b772620c9272f9ab8c4a /protocols
parent163ce5127e5c8244bccbdae72107ad101f70575f (diff)
code cleanup over mir_sntprintf + small bug fix
git-svn-id: http://svn.miranda-ng.org/main/trunk@11295 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r--protocols/GTalkExt/src/notifications.cpp6
-rw-r--r--protocols/GTalkExt/src/options.cpp4
-rw-r--r--protocols/Gadu-Gadu/src/gg.cpp6
-rw-r--r--protocols/Gadu-Gadu/src/gg_proto.cpp2
-rw-r--r--protocols/Gadu-Gadu/src/groupchat.cpp2
-rw-r--r--protocols/Gadu-Gadu/src/image.cpp4
-rw-r--r--protocols/IRCG/src/commandmonitor.cpp12
-rw-r--r--protocols/IRCG/src/scripting.cpp2
-rw-r--r--protocols/IRCG/src/windows.cpp8
-rw-r--r--protocols/IcqOscarJ/src/UI/loginpassword.cpp2
-rw-r--r--protocols/IcqOscarJ/src/icq_avatar.cpp4
-rw-r--r--protocols/JabberG/src/jabber_caps.cpp2
-rw-r--r--protocols/JabberG/src/jabber_iq_handlers.cpp2
-rw-r--r--protocols/JabberG/src/jabber_userinfo.cpp2
-rw-r--r--protocols/Sametime/src/sametime_session.cpp4
-rw-r--r--protocols/Twitter/src/proto.cpp8
-rw-r--r--protocols/WhatsApp/src/dialogs.cpp2
-rw-r--r--protocols/Yahoo/src/file_transfer.cpp2
18 files changed, 37 insertions, 37 deletions
diff --git a/protocols/GTalkExt/src/notifications.cpp b/protocols/GTalkExt/src/notifications.cpp
index 0cdbc1e3b4..dd72fefa24 100644
--- a/protocols/GTalkExt/src/notifications.cpp
+++ b/protocols/GTalkExt/src/notifications.cpp
@@ -254,7 +254,7 @@ void UnreadMailNotification(LPCSTR acc, LPCTSTR jid, LPCTSTR url, LPCTSTR unread
POPUPDATAT data = {0};
FormatPseudocontactDisplayName(&data.lptzContactName[0], jid, unreadCount);
- mir_sntprintf(&data.lptzText[0], SIZEOF(data.lptzText), TranslateT("You've received an e-mail\n%s unread threads"), unreadCount);
+ mir_sntprintf(data.lptzText, SIZEOF(data.lptzText), TranslateT("You've received an e-mail\n%s unread threads"), unreadCount);
ShowNotification(acc, &data, jid, url, unreadCount);
}
@@ -276,9 +276,9 @@ void UnreadThreadNotification(LPCSTR acc, LPCTSTR jid, LPCTSTR url, LPCTSTR unre
}
if ( ReadCheckbox(0, IDC_ADDSNIP, (DWORD)TlsGetValue(itlsSettings)))
- mir_sntprintf(&data.lptzText[0], SIZEOF(data.lptzText), TranslateTS(FULL_NOTIFICATION_FORMAT), mtn->subj, senders, mtn->snip);
+ mir_sntprintf(data.lptzText, SIZEOF(data.lptzText), TranslateTS(FULL_NOTIFICATION_FORMAT), mtn->subj, senders, mtn->snip);
else
- mir_sntprintf(&data.lptzText[0], SIZEOF(data.lptzText), TranslateTS(SHORT_NOTIFICATION_FORMAT), mtn->subj, senders);
+ mir_sntprintf(data.lptzText, SIZEOF(data.lptzText), TranslateTS(SHORT_NOTIFICATION_FORMAT), mtn->subj, senders);
free(senders);
diff --git a/protocols/GTalkExt/src/options.cpp b/protocols/GTalkExt/src/options.cpp
index cd199fdcb9..9fb1f144d4 100644
--- a/protocols/GTalkExt/src/options.cpp
+++ b/protocols/GTalkExt/src/options.cpp
@@ -157,8 +157,8 @@ INT_PTR CALLBACK AccOptionsDlgProc(HWND wnd, UINT msg, WPARAM wParam, LPARAM lPa
void ShowTestPopup(HWND wnd)
{
POPUPDATAT data = { 0 };
- mir_sntprintf(data.lptzContactName, MAX_CONTACTNAME, TranslateTS(TEST_LETTER_INBOX));
- mir_sntprintf(data.lptzText, MAX_SECONDLINE, TranslateTS(FULL_NOTIFICATION_FORMAT), TranslateTS(TEST_LETTER_SUBJECT), TranslateTS(TEST_LETTER_SENDER), TranslateTS(TEST_LETTER_SNIP));
+ mir_sntprintf(data.lptzContactName, SIZEOF(data.lptzContactName), TranslateTS(TEST_LETTER_INBOX));
+ mir_sntprintf(data.lptzText, SIZEOF(data.lptzText), TranslateTS(FULL_NOTIFICATION_FORMAT), TranslateTS(TEST_LETTER_SUBJECT), TranslateTS(TEST_LETTER_SENDER), TranslateTS(TEST_LETTER_SNIP));
int len = SendDlgItemMessage(wnd, IDC_TIMEOUTEDIT, WM_GETTEXTLENGTH, 0, 0) + 1;
LPTSTR timeout = (LPTSTR)malloc(len * sizeof(TCHAR));
diff --git a/protocols/Gadu-Gadu/src/gg.cpp b/protocols/Gadu-Gadu/src/gg.cpp
index bc9bcbb0f1..71f53ce6a7 100644
--- a/protocols/Gadu-Gadu/src/gg.cpp
+++ b/protocols/Gadu-Gadu/src/gg.cpp
@@ -155,20 +155,20 @@ void GGPROTO::cleanuplastplugin(DWORD version)
debugLogA("cleanuplastplugin() 1: version=%d Cleaning junk avatar files from < 0.11.0.2", version);
TCHAR avatarsPath[MAX_PATH];
- mir_sntprintf(avatarsPath, MAX_PATH, _T("%s\\%s"), VARST( _T("%miranda_avatarcache%")), m_tszUserName);
+ mir_sntprintf(avatarsPath, SIZEOF(avatarsPath), _T("%s\\%s"), VARST( _T("%miranda_avatarcache%")), m_tszUserName);
debugLog(_T("cleanuplastplugin() 1: miranda_avatarcache = %s"), avatarsPath);
if (avatarsPath != NULL){
HANDLE hFind = INVALID_HANDLE_VALUE;
TCHAR spec[MAX_PATH + 10];
- mir_sntprintf(spec, MAX_PATH + 10, _T("%s\\*.(null)"), avatarsPath);
+ mir_sntprintf(spec, SIZEOF(spec), _T("%s\\*.(null)"), avatarsPath);
WIN32_FIND_DATA ffd;
hFind = FindFirstFile(spec, &ffd);
if (hFind != INVALID_HANDLE_VALUE) {
do {
TCHAR filePathT [2*MAX_PATH + 10];
- mir_sntprintf(filePathT, 2*MAX_PATH + 10, _T("%s\\%s"), avatarsPath, ffd.cFileName);
+ mir_sntprintf(filePathT, SIZEOF(filePathT), _T("%s\\%s"), avatarsPath, ffd.cFileName);
if (!_taccess(filePathT, 0)){
debugLog(_T("cleanuplastplugin() 1: remove file = %s"), filePathT);
_tremove(filePathT);
diff --git a/protocols/Gadu-Gadu/src/gg_proto.cpp b/protocols/Gadu-Gadu/src/gg_proto.cpp
index 1f527f6bb5..716a75e376 100644
--- a/protocols/Gadu-Gadu/src/gg_proto.cpp
+++ b/protocols/Gadu-Gadu/src/gg_proto.cpp
@@ -69,7 +69,7 @@ GGPROTO::GGPROTO(const char* pszProtoName, const TCHAR* tszUserName) :
db_set_resident(m_szModuleName, GG_KEY_AVATARREQUESTED);
TCHAR szPath[MAX_PATH];
- mir_sntprintf(szPath, MAX_PATH, _T("%s\\%s\\ImageCache"), (TCHAR*)VARST( _T("%miranda_userdata%")), m_tszUserName);
+ mir_sntprintf(szPath, SIZEOF(szPath), _T("%s\\%s\\ImageCache"), (TCHAR*)VARST( _T("%miranda_userdata%")), m_tszUserName);
hImagesFolder = FoldersRegisterCustomPathT(LPGEN("Images"), m_szModuleName, szPath, m_tszUserName);
DWORD dwVersion;
diff --git a/protocols/Gadu-Gadu/src/groupchat.cpp b/protocols/Gadu-Gadu/src/groupchat.cpp
index 895f81a314..070f28cb57 100644
--- a/protocols/Gadu-Gadu/src/groupchat.cpp
+++ b/protocols/Gadu-Gadu/src/groupchat.cpp
@@ -305,7 +305,7 @@ TCHAR* GGPROTO::gc_getchat(uin_t sender, uin_t *recipients, int recipients_count
// Create new chat window
TCHAR status[256];
TCHAR *senderName = sender ? pcli->pfnGetContactDisplayName(getcontact(sender, 1, 0, NULL), 0) : NULL;
- mir_sntprintf(status, 255, (sender) ? TranslateT("%s initiated the conference.") : TranslateT("This is my own conference."), senderName);
+ mir_sntprintf(status, SIZEOF(status), (sender) ? TranslateT("%s initiated the conference.") : TranslateT("This is my own conference."), senderName);
GCSESSION gcwindow = { sizeof(gcwindow) };
gcwindow.iType = GCW_CHATROOM;
diff --git a/protocols/Gadu-Gadu/src/image.cpp b/protocols/Gadu-Gadu/src/image.cpp
index fd7ef6e2ab..42a612e758 100644
--- a/protocols/Gadu-Gadu/src/image.cpp
+++ b/protocols/Gadu-Gadu/src/image.cpp
@@ -813,7 +813,7 @@ int GGPROTO::img_displayasmsg(MCONTACT hContact, void *img)
if (hImagesFolder == NULL || FoldersGetCustomPathT(hImagesFolder, path, MAX_PATH, _T(""))) {
TCHAR *tmpPath = Utils_ReplaceVarsT( _T("%miranda_userdata%"));
- tPathLen = mir_sntprintf(szPath, MAX_PATH, _T("%s\\%s\\ImageCache"), tmpPath, m_tszUserName);
+ tPathLen = mir_sntprintf(szPath, SIZEOF(szPath), _T("%s\\%s\\ImageCache"), tmpPath, m_tszUserName);
mir_free(tmpPath);
}
else {
@@ -840,7 +840,7 @@ int GGPROTO::img_displayasmsg(MCONTACT hContact, void *img)
for (i = 1; ; ++i)
{
if ((res = gg_img_isexists(szPath, dat)) != -1) break;
- mir_sntprintf(szPath, MAX_PATH, _T("%.*s (%u)%s"), pImgext - szPath, szPath, i, imgext);
+ mir_sntprintf(szPath, SIZEOF(szPath), _T("%.*s (%u)%s"), pImgext - szPath, szPath, i, imgext);
}
if (res == 0) {
diff --git a/protocols/IRCG/src/commandmonitor.cpp b/protocols/IRCG/src/commandmonitor.cpp
index a96cd06395..2065a34e91 100644
--- a/protocols/IRCG/src/commandmonitor.cpp
+++ b/protocols/IRCG/src/commandmonitor.cpp
@@ -544,7 +544,7 @@ bool CIrcProto::OnIrc_MODE(const CIrcMessage* pmsg)
sParams += _T(" ") + pmsg->parameters[i];
TCHAR temp[4000];
- mir_sntprintf(temp, 3999, TranslateT("%s sets mode %s%s"), pmsg->prefix.sNick.c_str(), sModes.c_str(), sParams.c_str());
+ mir_sntprintf(temp, SIZEOF(temp), TranslateT("%s sets mode %s%s"), pmsg->prefix.sNick.c_str(), sModes.c_str(), sParams.c_str());
DoEvent(GC_EVENT_INFORMATION, pmsg->parameters[0].c_str(), pmsg->prefix.sNick.c_str(), temp, NULL, NULL, NULL, true, false);
}
@@ -1677,7 +1677,7 @@ bool CIrcProto::OnIrc_WHOIS_OTHER(const CIrcMessage* pmsg)
TCHAR temp[1024], temp2[1024];
m_whoisDlg->m_InfoOther.GetText(temp, 1000);
mir_tstrcat(temp, _T("%s\r\n"));
- mir_sntprintf(temp2, 1020, temp, pmsg->parameters[2].c_str());
+ mir_sntprintf(temp2, SIZEOF(temp2), temp, pmsg->parameters[2].c_str());
m_whoisDlg->m_InfoOther.SetText(temp2);
}
ShowMessage(pmsg);
@@ -1713,13 +1713,13 @@ bool CIrcProto::OnIrc_WHOIS_IDLE(const CIrcMessage* pmsg)
TCHAR temp[100];
if (D)
- mir_sntprintf(temp, 99, TranslateT("%ud, %uh, %um, %us"), D, H, M, S);
+ mir_sntprintf(temp, SIZEOF(temp), TranslateT("%ud, %uh, %um, %us"), D, H, M, S);
else if (H)
- mir_sntprintf(temp, 99, TranslateT("%uh, %um, %us"), H, M, S);
+ mir_sntprintf(temp, SIZEOF(temp), TranslateT("%uh, %um, %us"), H, M, S);
else if (M)
- mir_sntprintf(temp, 99, TranslateT("%um, %us"), M, S);
+ mir_sntprintf(temp, SIZEOF(temp), TranslateT("%um, %us"), M, S);
else if (S)
- mir_sntprintf(temp, 99, TranslateT("%us"), S);
+ mir_sntprintf(temp, SIZEOF(temp), TranslateT("%us"), S);
else
temp[0] = 0;
diff --git a/protocols/IRCG/src/scripting.cpp b/protocols/IRCG/src/scripting.cpp
index 4b18be6f63..cbbd1679f7 100644
--- a/protocols/IRCG/src/scripting.cpp
+++ b/protocols/IRCG/src/scripting.cpp
@@ -148,7 +148,7 @@ INT_PTR __cdecl CIrcProto::Scripting_GetIrcData(WPARAM, LPARAM lparam)
gci.pszID = S.c_str();
if (!CallServiceSync(MS_GC_GETINFO, 0, (LPARAM)&gci)) {
TCHAR szTemp[40];
- mir_sntprintf(szTemp, 35, _T("%u"), gci.iCount);
+ mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%u"), gci.iCount);
sOutput = szTemp;
}
}
diff --git a/protocols/IRCG/src/windows.cpp b/protocols/IRCG/src/windows.cpp
index 136ee34f50..3cdb907f98 100644
--- a/protocols/IRCG/src/windows.cpp
+++ b/protocols/IRCG/src/windows.cpp
@@ -970,7 +970,7 @@ void CManagerDlg::OnAdd(CCtrlButton*)
TCHAR temp2[450];
TCHAR window[256];
GetDlgItemText(m_hwnd, IDC_CAPTION, window, SIZEOF(window));
- mir_sntprintf(temp2, 450, _T("/MODE %s %s %s"), window, mode, _T("%question"));
+ mir_sntprintf(temp2, SIZEOF(temp2), _T("/MODE %s %s %s"), window, mode, _T("%question"));
SetDlgItemText(addban_hWnd, IDC_HIDDENEDIT, temp2);
dlg->Activate();
}
@@ -1013,7 +1013,7 @@ void CManagerDlg::OnEdit(CCtrlButton*)
TCHAR temp2[450];
TCHAR window[256];
GetDlgItemText(m_hwnd, IDC_CAPTION, window, SIZEOF(window));
- mir_sntprintf(temp2, 450, _T("/MODE %s -%s %s%s/MODE %s +%s %s"), window, mode, user.c_str(), _T("%newl"), window, mode, _T("%question"));
+ mir_sntprintf(temp2, SIZEOF(temp2), _T("/MODE %s -%s %s%s/MODE %s +%s %s"), window, mode, user.c_str(), _T("%newl"), window, mode, _T("%question"));
SetDlgItemText(addban_hWnd, IDC_HIDDENEDIT, temp2);
dlg->Activate();
}
@@ -1192,9 +1192,9 @@ void CManagerDlg::OnApplyModes(CCtrlButton*)
mir_tstrcat(temp, window);
mir_tstrcat(temp, _T(" "));
if (mir_tstrlen(toremove))
- mir_sntprintf(temp, 499, _T("%s-%s"), temp, toremove);
+ mir_sntprintf(temp, SIZEOF(temp), _T("%s-%s"), temp, toremove);
if (mir_tstrlen(toadd))
- mir_sntprintf(temp, 499, _T("%s+%s"), temp, toadd);
+ mir_sntprintf(temp, SIZEOF(temp), _T("%s+%s"), temp, toadd);
if (!appendixremove.IsEmpty())
mir_tstrcat(temp, appendixremove.c_str());
if (!appendixadd.IsEmpty())
diff --git a/protocols/IcqOscarJ/src/UI/loginpassword.cpp b/protocols/IcqOscarJ/src/UI/loginpassword.cpp
index 3464db871a..951b5c7b46 100644
--- a/protocols/IcqOscarJ/src/UI/loginpassword.cpp
+++ b/protocols/IcqOscarJ/src/UI/loginpassword.cpp
@@ -42,7 +42,7 @@ INT_PTR CALLBACK LoginPasswdDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
DWORD dwUin = ppro->getContactUin(NULL);
TCHAR pszUIN[MAX_PATH];
- mir_sntprintf(pszUIN, 128, TranslateT("Enter a password for UIN %u:"), dwUin);
+ mir_sntprintf(pszUIN, SIZEOF(pszUIN), TranslateT("Enter a password for UIN %u:"), dwUin);
SetDlgItemText(hwndDlg, IDC_INSTRUCTION, pszUIN);
SendDlgItemMessage(hwndDlg, IDC_LOGINPW, EM_LIMITTEXT, PASSWORDMAXLEN - 1, 0);
diff --git a/protocols/IcqOscarJ/src/icq_avatar.cpp b/protocols/IcqOscarJ/src/icq_avatar.cpp
index 1dbc41d834..e5aa5d9657 100644
--- a/protocols/IcqOscarJ/src/icq_avatar.cpp
+++ b/protocols/IcqOscarJ/src/icq_avatar.cpp
@@ -95,10 +95,10 @@ void CIcqProto::GetFullAvatarFileName(int dwUin, const char *szUid, int dwFormat
void CIcqProto::GetAvatarFileName(int dwUin, const char *szUid, TCHAR *pszDest, size_t cbLen)
{
TCHAR szPath[MAX_PATH * 2];
- mir_sntprintf(szPath, MAX_PATH * 2, _T("%s\\%S\\"), VARST(_T("%miranda_avatarcache%")), m_szModuleName);
+ mir_sntprintf(szPath, SIZEOF(szPath), _T("%s\\%S\\"), VARST(_T("%miranda_avatarcache%")), m_szModuleName);
FOLDERSGETDATA fgd = { sizeof(fgd) };
- fgd.nMaxPathSize = MAX_PATH * 2;
+ fgd.nMaxPathSize = SIZEOF(szPath);
fgd.szPathT = szPath;
fgd.flags = FF_TCHAR;
diff --git a/protocols/JabberG/src/jabber_caps.cpp b/protocols/JabberG/src/jabber_caps.cpp
index f431ea4b53..0df3d19615 100644
--- a/protocols/JabberG/src/jabber_caps.cpp
+++ b/protocols/JabberG/src/jabber_caps.cpp
@@ -201,7 +201,7 @@ JabberCapsBits CJabberProto::GetTotalJidCapabilites(const TCHAR *jid)
if (item) {
for (int i = 0; i < item->arResources.getCount(); i++) {
TCHAR szFullJid[JABBER_MAX_JID_LEN];
- mir_sntprintf(szFullJid, JABBER_MAX_JID_LEN, _T("%s/%s"), szBareJid, item->arResources[i]->m_tszResourceName);
+ mir_sntprintf(szFullJid, SIZEOF(szFullJid), _T("%s/%s"), szBareJid, item->arResources[i]->m_tszResourceName);
JabberCapsBits jcb = GetResourceCapabilites(szFullJid, FALSE);
if (!(jcb & JABBER_RESOURCE_CAPS_ERROR))
jcbToReturn |= jcb;
diff --git a/protocols/JabberG/src/jabber_iq_handlers.cpp b/protocols/JabberG/src/jabber_iq_handlers.cpp
index bf2837a9d0..7268012267 100644
--- a/protocols/JabberG/src/jabber_iq_handlers.cpp
+++ b/protocols/JabberG/src/jabber_iq_handlers.cpp
@@ -311,7 +311,7 @@ BOOL GetOSDisplayString(LPTSTR pszOS, int BUFSIZE)
}
TCHAR buf[80];
- mir_sntprintf(buf, 80, TEXT(" (build %d)"), osvi.dwBuildNumber);
+ mir_sntprintf(buf, SIZEOF(buf), TEXT(" (build %d)"), osvi.dwBuildNumber);
StringCchCat(pszOS, BUFSIZE, buf);
return TRUE;
}
diff --git a/protocols/JabberG/src/jabber_userinfo.cpp b/protocols/JabberG/src/jabber_userinfo.cpp
index 21a511149b..543f6c40f4 100644
--- a/protocols/JabberG/src/jabber_userinfo.cpp
+++ b/protocols/JabberG/src/jabber_userinfo.cpp
@@ -320,7 +320,7 @@ static void sttFillAdvStatusInfo(CJabberProto *ppro, HWND hwndTree, HTREEITEM ht
if (szAdvStatusIcon && szAdvStatusTitle && *szAdvStatusTitle) {
TCHAR szText[2048];
if (szAdvStatusText && *szAdvStatusText)
- mir_sntprintf(szText, 2047, _T("%s (%s)"), TranslateTS(szAdvStatusTitle), szAdvStatusText);
+ mir_sntprintf(szText, SIZEOF(szText), _T("%s (%s)"), TranslateTS(szAdvStatusTitle), szAdvStatusText);
else
_tcsncpy_s(szText, TranslateTS(szAdvStatusTitle), _TRUNCATE);
sttFillInfoLine(hwndTree, htiRoot, Skin_GetIcon(szAdvStatusIcon), szTitle, szText, dwInfoLine);
diff --git a/protocols/Sametime/src/sametime_session.cpp b/protocols/Sametime/src/sametime_session.cpp
index d2922c976c..3a5a05fd92 100644
--- a/protocols/Sametime/src/sametime_session.cpp
+++ b/protocols/Sametime/src/sametime_session.cpp
@@ -155,7 +155,7 @@ void __cdecl SessionAnnounce(struct mwSession* session, struct mwLoginInfo* from
TCHAR stzFromBuff[256];
stzFrom = mir_utf8decodeT(from->user_name);
stzText = mir_utf8decodeT(text);
- mir_sntprintf(stzFromBuff, 256, TranslateT("Session announcement - from '%s'"), stzFrom);
+ mir_sntprintf(stzFromBuff, SIZEOF(stzFromBuff), TranslateT("Session announcement - from '%s'"), stzFrom);
MessageBox(0, TranslateTS(stzText), stzFromBuff, MB_OK);
mir_free(stzText);
mir_free(stzFrom);
@@ -213,7 +213,7 @@ void __cdecl SessionSetUserStatus(struct mwSession* session)
default:
TCHAR buff[512];
- mir_sntprintf(buff, 512, TranslateT("Unknown user status: %d"), us.status);
+ mir_sntprintf(buff, SIZEOF(buff), TranslateT("Unknown user status: %d"), us.status);
proto->showPopup(buff, SAMETIME_POPUP_ERROR);
proto->debugLog(buff);
diff --git a/protocols/Twitter/src/proto.cpp b/protocols/Twitter/src/proto.cpp
index f00c08e7af..56e63acaf7 100644
--- a/protocols/Twitter/src/proto.cpp
+++ b/protocols/Twitter/src/proto.cpp
@@ -404,8 +404,8 @@ int TwitterProto::ShowPinDialog()
void TwitterProto::ShowPopup(const wchar_t *text, int Error)
{
POPUPDATAT popup = {};
- mir_sntprintf(popup.lptzContactName,MAX_CONTACTNAME,TranslateT("%s Protocol"),m_tszUserName);
- wcs_to_tcs(CP_UTF8,text,popup.lptzText,MAX_SECONDLINE);
+ mir_sntprintf(popup.lptzContactName, SIZEOF(popup.lptzContactName), TranslateT("%s Protocol"), m_tszUserName);
+ wcs_to_tcs(CP_UTF8, text, popup.lptzText, SIZEOF(popup.lptzText));
if (Error) {
popup.iSeconds = -1;
@@ -422,8 +422,8 @@ void TwitterProto::ShowPopup(const wchar_t *text, int Error)
void TwitterProto::ShowPopup(const char *text, int Error)
{
POPUPDATAT popup = {};
- mir_sntprintf(popup.lptzContactName,MAX_CONTACTNAME,TranslateT("%s Protocol"),m_tszUserName);
- mbcs_to_tcs(CP_UTF8,text,popup.lptzText,MAX_SECONDLINE);
+ mir_sntprintf(popup.lptzContactName, SIZEOF(popup.lptzContactName), TranslateT("%s Protocol"), m_tszUserName);
+ mbcs_to_tcs(CP_UTF8, text, popup.lptzText, SIZEOF(popup.lptzText));
if (Error) {
popup.iSeconds = -1;
popup.colorBack = 0x000000FF;
diff --git a/protocols/WhatsApp/src/dialogs.cpp b/protocols/WhatsApp/src/dialogs.cpp
index 06bb5c1371..a085cf58c1 100644
--- a/protocols/WhatsApp/src/dialogs.cpp
+++ b/protocols/WhatsApp/src/dialogs.cpp
@@ -150,7 +150,7 @@ INT_PTR CALLBACK WhatsAppInputBoxProc(HWND hwndDlg, UINT message, WPARAM wparam,
ib = reinterpret_cast<input_box*>(GetWindowLongPtr(hwndDlg, GWLP_USERDATA));
size_t len = SendDlgItemMessage(hwndDlg, IDC_VALUE, WM_GETTEXTLENGTH, 0, 0);
TCHAR str[4];
- mir_sntprintf(str, 4, TEXT("%d"), ib->limit - len);
+ mir_sntprintf(str, SIZEOF(str), TEXT("%d"), ib->limit - len);
//SetDlgItemText(hwndDlg,IDC_CHARACTERS,str);
EnableWindow(GetDlgItem(hwndDlg, IDC_OK), len > 0);
diff --git a/protocols/Yahoo/src/file_transfer.cpp b/protocols/Yahoo/src/file_transfer.cpp
index 1bc0aa3eb6..d9aac31601 100644
--- a/protocols/Yahoo/src/file_transfer.cpp
+++ b/protocols/Yahoo/src/file_transfer.cpp
@@ -309,7 +309,7 @@ static void dl_file(int id, INT_PTR fd, int error, const char *filename, unsigne
*
* Don't rely on workingDir to be right, since it's not used to check if file exists.
*/
- mir_sntprintf(filefull, MAX_PATH, _T("%s\\%s"), sf->pfts.tszWorkingDir, sf->pfts.tszCurrentFile);
+ mir_sntprintf(filefull, SIZEOF(filefull), _T("%s\\%s"), sf->pfts.tszWorkingDir, sf->pfts.tszCurrentFile);
FREE(sf->pfts.tszCurrentFile);
sf->pfts.tszCurrentFile = _tcsdup(filefull);