summaryrefslogtreecommitdiff
path: root/protocols/IRCG
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/IRCG
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/IRCG')
-rw-r--r--protocols/IRCG/src/commandmonitor.cpp12
-rw-r--r--protocols/IRCG/src/scripting.cpp2
-rw-r--r--protocols/IRCG/src/windows.cpp8
3 files changed, 11 insertions, 11 deletions
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())