diff options
author | George Hazan <george.hazan@gmail.com> | 2015-06-04 22:23:03 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-06-04 22:23:03 +0000 |
commit | efd438ad7b533ba2adb4f22a1cb358ee449db825 (patch) | |
tree | a5a4a84ee1b46b8902fc646d42056d574369b85a /protocols | |
parent | 65c19c2a4f8e907c56fbdbfb5bf500f33c218574 (diff) |
new mir_sntprintf templates without SIZEOF
git-svn-id: http://svn.miranda-ng.org/main/trunk@14004 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
60 files changed, 208 insertions, 208 deletions
diff --git a/protocols/AimOscar/src/proto.cpp b/protocols/AimOscar/src/proto.cpp index 5a8ac4f8e8..91618cf53e 100644 --- a/protocols/AimOscar/src/proto.cpp +++ b/protocols/AimOscar/src/proto.cpp @@ -52,14 +52,14 @@ CAimProto::CAimProto(const char* aProtoName, const TCHAR* aUserName) : nlu.cbSize = sizeof(nlu);
nlu.flags = NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR;
nlu.szSettingsModule = m_szModuleName;
- mir_sntprintf(descr, SIZEOF(descr), TranslateT("%s server connection"), m_tszUserName);
+ mir_sntprintf(descr, TranslateT("%s server connection"), m_tszUserName);
nlu.ptszDescriptiveName = descr;
m_hNetlibUser = (HANDLE) CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
char szP2P[128];
mir_snprintf(szP2P, SIZEOF(szP2P), "%sP2P", m_szModuleName);
nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_TCHAR;
- mir_sntprintf(descr, SIZEOF(descr), TranslateT("%s Client-to-client connection"), m_tszUserName);
+ mir_sntprintf(descr, TranslateT("%s Client-to-client connection"), m_tszUserName);
nlu.szSettingsModule = szP2P;
nlu.minIncomingPorts = 1;
hNetlibPeer = (HANDLE) CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
diff --git a/protocols/FacebookRM/src/communication.cpp b/protocols/FacebookRM/src/communication.cpp index e9e3de967f..1bc95ff696 100644 --- a/protocols/FacebookRM/src/communication.cpp +++ b/protocols/FacebookRM/src/communication.cpp @@ -696,7 +696,7 @@ void loginError(FacebookProto *proto, std::string error_str) { proto->debugLogA("!!! Login error: %s", !error_str.empty() ? error_str.c_str() : "Unknown error"); TCHAR buf[200]; - mir_sntprintf(buf, SIZEOF(buf), TranslateT("Login error: %s"), + mir_sntprintf(buf, TranslateT("Login error: %s"), (error_str.empty()) ? TranslateT("Unknown error") : ptrT(mir_utf8decodeT(error_str.c_str()))); proto->facy.client_notify(buf); } diff --git a/protocols/FacebookRM/src/proto.cpp b/protocols/FacebookRM/src/proto.cpp index 968a0c5c99..4910eba167 100644 --- a/protocols/FacebookRM/src/proto.cpp +++ b/protocols/FacebookRM/src/proto.cpp @@ -93,12 +93,12 @@ FacebookProto::FacebookProto(const char* proto_name, const TCHAR* username) : NETLIBUSER nlu = { sizeof(nlu) }; nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR; nlu.szSettingsModule = m_szModuleName; - mir_sntprintf(descr, SIZEOF(descr), TranslateT("%s server connection"), m_tszUserName); + mir_sntprintf(descr, TranslateT("%s server connection"), m_tszUserName); nlu.ptszDescriptiveName = descr; m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu); if (m_hNetlibUser == NULL) { TCHAR error[200]; - mir_sntprintf(error, SIZEOF(error), TranslateT("Unable to initialize Netlib for %s."), m_tszUserName); + mir_sntprintf(error, TranslateT("Unable to initialize Netlib for %s."), m_tszUserName); MessageBox(NULL, error, _T("Miranda NG"), MB_OK | MB_ICONERROR); } diff --git a/protocols/Gadu-Gadu/src/avatar.cpp b/protocols/Gadu-Gadu/src/avatar.cpp index 1d27e336ed..c1d4936588 100644 --- a/protocols/Gadu-Gadu/src/avatar.cpp +++ b/protocols/Gadu-Gadu/src/avatar.cpp @@ -37,7 +37,7 @@ void GGPROTO::getAvatarFilename(MCONTACT hContact, TCHAR *pszDest, int cbLen) else {
debugLog(_T("getAvatarFilename(): Can not create directory for avatar cache: %s. errno=%d: %s"), pszDest, errno, strerror(errno));
TCHAR error[512];
- mir_sntprintf(error, SIZEOF(error), TranslateT("Cannot create avatars cache directory. ERROR: %d: %s\n%s"), errno, _tcserror(errno), pszDest);
+ mir_sntprintf(error, TranslateT("Cannot create avatars cache directory. ERROR: %d: %s\n%s"), errno, _tcserror(errno), pszDest);
showpopup(m_tszUserName, error, GG_POPUP_ERROR | GG_POPUP_ALLOW_MSGBOX | GG_POPUP_ONCE);
}
}
@@ -271,7 +271,7 @@ void __cdecl GGPROTO::avatarrequestthread(void*) } else {
debugLog(_T("avatarrequestthread(): _topen file %s error. errno=%d: %s"), ai.filename, errno, strerror(errno));
TCHAR error[512];
- mir_sntprintf(error, SIZEOF(error), TranslateT("Cannot create avatar file. ERROR: %d: %s\n%s"), errno, _tcserror(errno), ai.filename);
+ mir_sntprintf(error, TranslateT("Cannot create avatar file. ERROR: %d: %s\n%s"), errno, _tcserror(errno), ai.filename);
showpopup(m_tszUserName, error, GG_POPUP_ERROR);
}
}
@@ -363,7 +363,7 @@ void __cdecl GGPROTO::setavatarthread(void *param) if (file_fd == -1) {
debugLogA("setavatarthread(): Failed to open avatar file errno=%d: %s.", errno, strerror(errno));
TCHAR error[512];
- mir_sntprintf(error, SIZEOF(error), TranslateT("Cannot open avatar file. ERROR: %d: %s\n%s"), errno, _tcserror(errno), szFilename);
+ mir_sntprintf(error, TranslateT("Cannot open avatar file. ERROR: %d: %s\n%s"), errno, _tcserror(errno), szFilename);
showpopup(m_tszUserName, error, GG_POPUP_ERROR);
mir_free(szFilename);
int prevType = getByte(GG_KEY_AVATARTYPEPREV, -1);
diff --git a/protocols/Gadu-Gadu/src/core.cpp b/protocols/Gadu-Gadu/src/core.cpp index 70f393d3e9..f37120f268 100644 --- a/protocols/Gadu-Gadu/src/core.cpp +++ b/protocols/Gadu-Gadu/src/core.cpp @@ -361,7 +361,7 @@ void __cdecl GGPROTO::mainthread(void *) if (!(p.external_addr = gg_dnslookup(this, dbv.pszVal))) {
TCHAR error[128];
TCHAR* forwardHostT = mir_a2t(dbv.pszVal);
- mir_sntprintf(error, SIZEOF(error), TranslateT("External direct connections hostname %s is invalid. Disabling external host forwarding."), forwardHostT);
+ mir_sntprintf(error, TranslateT("External direct connections hostname %s is invalid. Disabling external host forwarding."), forwardHostT);
mir_free(forwardHostT);
showpopup(m_tszUserName, error, GG_POPUP_WARNING | GG_POPUP_ALLOW_MSGBOX);
}
@@ -392,7 +392,7 @@ retry: {
TCHAR error[128];
TCHAR* hostnameT = mir_a2t(hosts[hostnum].hostname);
- mir_sntprintf(error, SIZEOF(error), TranslateT("Server hostname %s is invalid. Using default hostname provided by the network."), hostnameT);
+ mir_sntprintf(error, TranslateT("Server hostname %s is invalid. Using default hostname provided by the network."), hostnameT);
mir_free(hostnameT);
showpopup(m_tszUserName, error, GG_POPUP_WARNING | GG_POPUP_ALLOW_MSGBOX);
}
@@ -423,7 +423,7 @@ retry: }
}
if (!perror) {
- mir_sntprintf(error, SIZEOF(error), TranslateT("Connection cannot be established. errno=%d: %s"),errno, strerror(errno));
+ mir_sntprintf(error, TranslateT("Connection cannot be established. errno=%d: %s"),errno, strerror(errno));
perror = error;
}
debugLogA("mainthread() (%x): %s", this, perror);
diff --git a/protocols/Gadu-Gadu/src/filetransfer.cpp b/protocols/Gadu-Gadu/src/filetransfer.cpp index 23f56f4a5b..61d8ab6014 100644 --- a/protocols/Gadu-Gadu/src/filetransfer.cpp +++ b/protocols/Gadu-Gadu/src/filetransfer.cpp @@ -677,7 +677,7 @@ HANDLE GGPROTO::dccfileallow(HANDLE hTransfer, const TCHAR* szPath) {
debugLogA("dccfileallow(): Failed to create file \"%s\". errno=%d: %s", fileName, errno, strerror(errno));
TCHAR error[512];
- mir_sntprintf(error, SIZEOF(error), TranslateT("Cannot create transfer file. ERROR: %d: %s (dcc)\n%s"), errno, _tcserror(errno), szPath);
+ mir_sntprintf(error, TranslateT("Cannot create transfer file. ERROR: %d: %s (dcc)\n%s"), errno, _tcserror(errno), szPath);
showpopup(m_tszUserName, error, GG_POPUP_ERROR);
ProtoBroadcastAck((MCONTACT)dcc->contact, ACKTYPE_FILE, ACKRESULT_FAILED, dcc, 0);
// Free transfer
@@ -726,7 +726,7 @@ HANDLE GGPROTO::dcc7fileallow(HANDLE hTransfer, const TCHAR* szPath) {
debugLogA("dcc7fileallow(): Failed to create file \"%s\". errno=%d: %s", fileName, errno, strerror(errno));
TCHAR error[512];
- mir_sntprintf(error, SIZEOF(error), TranslateT("Cannot create transfer file. ERROR: %d: %s (dcc7)\n%s"), errno, _tcserror(errno), szPath);
+ mir_sntprintf(error, TranslateT("Cannot create transfer file. ERROR: %d: %s (dcc7)\n%s"), errno, _tcserror(errno), szPath);
showpopup(m_tszUserName, error, GG_POPUP_ERROR);
gg_dcc7_reject(dcc7, GG_DCC7_REJECT_USER);
ProtoBroadcastAck((MCONTACT)dcc7->contact, ACKTYPE_FILE, ACKRESULT_FAILED, dcc7, 0);
diff --git a/protocols/Gadu-Gadu/src/gg_proto.cpp b/protocols/Gadu-Gadu/src/gg_proto.cpp index 9d0c8d4a2c..7c98ed6bc9 100644 --- a/protocols/Gadu-Gadu/src/gg_proto.cpp +++ b/protocols/Gadu-Gadu/src/gg_proto.cpp @@ -68,7 +68,7 @@ GGPROTO::GGPROTO(const char* pszProtoName, const TCHAR* tszUserName) : db_set_resident(m_szModuleName, GG_KEY_AVATARREQUESTED);
TCHAR szPath[MAX_PATH];
- mir_sntprintf(szPath, SIZEOF(szPath), _T("%s\\%s\\ImageCache"), (TCHAR*)VARST( _T("%miranda_userdata%")), m_tszUserName);
+ mir_sntprintf(szPath, _T("%s\\%s\\ImageCache"), (TCHAR*)VARST( _T("%miranda_userdata%")), m_tszUserName);
hImagesFolder = FoldersRegisterCustomPathT(LPGEN("Images"), m_szModuleName, szPath, m_tszUserName);
DWORD dwVersion;
@@ -452,7 +452,7 @@ HWND GGPROTO::SearchAdvanced(HWND hwndDlg) yearFrom = 0;
else
yearFrom = ay - yearFrom;
- mir_sntprintf(text, SIZEOF(text), _T("%d %d"), yearFrom, yearTo);
+ mir_sntprintf(text, _T("%d %d"), yearFrom, yearTo);
T2Utf age_utf8(text);
gg_pubdir50_add(req, GG_PUBDIR50_BIRTHYEAR, age_utf8);
diff --git a/protocols/Gadu-Gadu/src/groupchat.cpp b/protocols/Gadu-Gadu/src/groupchat.cpp index 0b9b9e21e0..1a1983e4e5 100644 --- a/protocols/Gadu-Gadu/src/groupchat.cpp +++ b/protocols/Gadu-Gadu/src/groupchat.cpp @@ -282,7 +282,7 @@ TCHAR* GGPROTO::gc_getchat(uin_t sender, uin_t *recipients, int recipients_count TCHAR *senderName = unknownSender ?
TranslateT("Unknown") : pcli->pfnGetContactDisplayName(getcontact(sender, 0, 0, NULL), 0);
TCHAR error[256];
- mir_sntprintf(error, SIZEOF(error), TranslateT("%s has initiated conference with %d participants (%d unknowns).\nDo you want to participate?"),
+ mir_sntprintf(error, TranslateT("%s has initiated conference with %d participants (%d unknowns).\nDo you want to participate?"),
senderName, recipients_count + 1, unknown);
chat->ignore = MessageBox(NULL, error, m_tszUserName, MB_OKCANCEL | MB_ICONEXCLAMATION) != IDOK;
}
diff --git a/protocols/Gadu-Gadu/src/image.cpp b/protocols/Gadu-Gadu/src/image.cpp index 7fccf30251..f92c77fac1 100644 --- a/protocols/Gadu-Gadu/src/image.cpp +++ b/protocols/Gadu-Gadu/src/image.cpp @@ -422,9 +422,9 @@ static INT_PTR CALLBACK gg_img_dlgproc(HWND hwndDlg, UINT msg, WPARAM wParam, LP TCHAR *szName = pcli->pfnGetContactDisplayName(dat->hContact, 0), szTitle[128];
if (dat->bReceiving)
- mir_sntprintf(szTitle, SIZEOF(szTitle), TranslateT("Image from %s"), szName);
+ mir_sntprintf(szTitle, TranslateT("Image from %s"), szName);
else
- mir_sntprintf(szTitle, SIZEOF(szTitle), TranslateT("Image for %s"), szName);
+ mir_sntprintf(szTitle, TranslateT("Image for %s"), szName);
SetWindowText(hwndDlg, szTitle);
// Store client extents
@@ -505,7 +505,7 @@ static INT_PTR CALLBACK gg_img_dlgproc(HWND hwndDlg, UINT msg, WPARAM wParam, LP if (dat->bReceiving)
{
TCHAR szTitle[128];
- mir_sntprintf(szTitle, SIZEOF(szTitle), _T("%s (%d / %d)"), img->lpszFileName, dat->nImg, dat->nImgTotal);
+ mir_sntprintf(szTitle, _T("%s (%d / %d)"), img->lpszFileName, dat->nImg, dat->nImgTotal);
SetDlgItemText(hwndDlg, IDC_IMG_NAME, szTitle);
}
else
@@ -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, SIZEOF(szPath), _T("%s\\%s\\ImageCache"), tmpPath, m_tszUserName);
+ tPathLen = mir_sntprintf(szPath, _T("%s\\%s\\ImageCache"), tmpPath, m_tszUserName);
mir_free(tmpPath);
}
else {
@@ -828,7 +828,7 @@ int GGPROTO::img_displayasmsg(MCONTACT hContact, void *img) } else {
debugLog(_T("img_displayasmsg(): Can not create directory for image cache: %s. errno=%d: %s"), szPath, errno, strerror(errno));
TCHAR error[512];
- mir_sntprintf(error, SIZEOF(error), TranslateT("Cannot create image cache directory. ERROR: %d: %s\n%s"), errno, _tcserror(errno), szPath);
+ mir_sntprintf(error, TranslateT("Cannot create image cache directory. ERROR: %d: %s\n%s"), errno, _tcserror(errno), szPath);
showpopup(m_tszUserName, error, GG_POPUP_ERROR | GG_POPUP_ALLOW_MSGBOX | GG_POPUP_ONCE);
}
}
@@ -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, SIZEOF(szPath), _T("%.*s (%u)%s"), pImgext - szPath, szPath, i, imgext);
+ mir_sntprintf(szPath, _T("%.*s (%u)%s"), pImgext - szPath, szPath, i, imgext);
}
if (res == 0) {
@@ -852,7 +852,7 @@ int GGPROTO::img_displayasmsg(MCONTACT hContact, void *img) } else {
debugLog(_T("img_displayasmsg(): Cannot open file %s for write image. errno=%d: %s"), szPath, errno, strerror(errno));
TCHAR error[512];
- mir_sntprintf(error, SIZEOF(error), TranslateT("Cannot save received image to file. ERROR: %d: %s\n%s"), errno, _tcserror(errno), szPath);
+ mir_sntprintf(error, TranslateT("Cannot save received image to file. ERROR: %d: %s\n%s"), errno, _tcserror(errno), szPath);
showpopup(m_tszUserName, error, GG_POPUP_ERROR);
return 0;
}
@@ -975,7 +975,7 @@ void* GGPROTO::img_loadpicture(gg_event* e, TCHAR *szFileName) free(dat);
debugLog(_T("img_loadpicture(): fopen(\"%s\", \"rb\") failed. errno=%d: %s"), szFileName, errno, strerror(errno));
TCHAR error[512];
- mir_sntprintf(error, SIZEOF(error), TranslateT("Cannot open image file. ERROR: %d: %s\n%s"), errno, _tcserror(errno), szFileName);
+ mir_sntprintf(error, TranslateT("Cannot open image file. ERROR: %d: %s\n%s"), errno, _tcserror(errno), szFileName);
showpopup(m_tszUserName, error, GG_POPUP_ERROR);
return NULL;
}
diff --git a/protocols/Gadu-Gadu/src/import.cpp b/protocols/Gadu-Gadu/src/import.cpp index 2ca709ae01..b82a30418f 100644 --- a/protocols/Gadu-Gadu/src/import.cpp +++ b/protocols/Gadu-Gadu/src/import.cpp @@ -278,7 +278,7 @@ INT_PTR GGPROTO::import_server(WPARAM wParam, LPARAM lParam) {
TCHAR error[128];
gg_LeaveCriticalSection(&sess_mutex, "import_server", 65, 1, "sess_mutex", 1);
- mir_sntprintf(error, SIZEOF(error), TranslateT("List cannot be imported because of error:\n\t%s (Error: %d)"), _tcserror(errno), errno);
+ mir_sntprintf(error, TranslateT("List cannot be imported because of error:\n\t%s (Error: %d)"), _tcserror(errno), errno);
MessageBox(NULL, error, m_tszUserName, MB_OK | MB_ICONSTOP);
debugLogA("import_server(): Cannot import list. errno:%d: %s", errno, strerror(errno));
}
@@ -316,7 +316,7 @@ INT_PTR GGPROTO::remove_server(WPARAM wParam, LPARAM lParam) {
TCHAR error[128];
gg_LeaveCriticalSection(&sess_mutex, "remove_server", 66, 1, "sess_mutex", 1);
- mir_sntprintf(error, SIZEOF(error), TranslateT("List cannot be removed because of error: %s (Error: %d)"), _tcserror(errno), errno);
+ mir_sntprintf(error, TranslateT("List cannot be removed because of error: %s (Error: %d)"), _tcserror(errno), errno);
MessageBox(NULL, error, m_tszUserName, MB_OK | MB_ICONSTOP);
debugLogA("remove_server(): Cannot remove list. errno=%d: %s", errno, strerror(errno));
}
@@ -389,7 +389,7 @@ INT_PTR GGPROTO::import_text(WPARAM wParam, LPARAM lParam) else
{
TCHAR error[256];
- mir_sntprintf(error, SIZEOF(error), TranslateT("List cannot be imported from file \"%s\" because of error:\n\t%s (Error: %d)"), str, _tcserror(errno), errno);
+ mir_sntprintf(error, TranslateT("List cannot be imported from file \"%s\" because of error:\n\t%s (Error: %d)"), str, _tcserror(errno), errno);
MessageBox(NULL, error, m_tszUserName, MB_OK | MB_ICONSTOP);
debugLog(_T("import_text(): Cannot import list from file \"%s\". errno=%d: %s"), str, errno, strerror(errno));
}
@@ -450,7 +450,7 @@ INT_PTR GGPROTO::export_text(WPARAM wParam, LPARAM lParam) else
{
TCHAR error[128];
- mir_sntprintf(error, SIZEOF(error), TranslateT("List cannot be exported to file \"%s\" because of error:\n\t%s (Error: %d)"), str, _tcserror(errno), errno);
+ mir_sntprintf(error, TranslateT("List cannot be exported to file \"%s\" because of error:\n\t%s (Error: %d)"), str, _tcserror(errno), errno);
MessageBox(NULL, error, m_tszUserName, MB_OK | MB_ICONSTOP);
debugLogA("export_text(): Cannot export list to file \"%s\". errno=%d: %s", str, errno, strerror(errno));
}
@@ -494,7 +494,7 @@ INT_PTR GGPROTO::export_server(WPARAM wParam, LPARAM lParam) {
TCHAR error[128];
gg_LeaveCriticalSection(&sess_mutex, "export_server", 67, 1, "sess_mutex", 1);
- mir_sntprintf(error, SIZEOF(error), TranslateT("List cannot be exported because of error:\n\t%s (Error: %d)"), _tcserror(errno), errno);
+ mir_sntprintf(error, TranslateT("List cannot be exported because of error:\n\t%s (Error: %d)"), _tcserror(errno), errno);
MessageBox(NULL, error, m_tszUserName, MB_OK | MB_ICONSTOP);
debugLogA("export_server(): Cannot export list. errno=%d: %s", errno, strerror(errno));
}
diff --git a/protocols/Gadu-Gadu/src/ownerinfo.cpp b/protocols/Gadu-Gadu/src/ownerinfo.cpp index 7c8da3e1a4..96707513f2 100644 --- a/protocols/Gadu-Gadu/src/ownerinfo.cpp +++ b/protocols/Gadu-Gadu/src/ownerinfo.cpp @@ -57,7 +57,7 @@ void __cdecl GGPROTO::remindpasswordthread(void *param) if (!(h = gg_remind_passwd3(rp->uin, rp->email, token.id, token.val, 0)))
{
TCHAR error[128];
- mir_sntprintf(error, SIZEOF(error), TranslateT("Password could not be reminded because of error:\n\t%s (Error: %d)"), _tcserror(errno), errno);
+ mir_sntprintf(error, TranslateT("Password could not be reminded because of error:\n\t%s (Error: %d)"), _tcserror(errno), errno);
MessageBox(NULL, error, m_tszUserName, MB_OK | MB_ICONSTOP);
debugLogA("remindpasswordthread(): Password could not be reminded. errno=%d: %s", errno, strerror(errno));
}
diff --git a/protocols/Gadu-Gadu/src/services.cpp b/protocols/Gadu-Gadu/src/services.cpp index e9c5b1adc6..834ccc8876 100644 --- a/protocols/Gadu-Gadu/src/services.cpp +++ b/protocols/Gadu-Gadu/src/services.cpp @@ -240,7 +240,7 @@ INT_PTR GGPROTO::getavatarinfo(WPARAM wParam, LPARAM lParam) if (_tremove(pai->filename) != 0){
debugLog(_T("getavatarinfo(): refresh. _tremove 1 file %s error. errno=%d: %s"), pai->filename, errno, strerror(errno));
TCHAR error[512];
- mir_sntprintf(error, SIZEOF(error), TranslateT("Cannot remove old avatar file before refresh. ERROR: %d: %s\n%s"), errno, _tcserror(errno), pai->filename);
+ mir_sntprintf(error, TranslateT("Cannot remove old avatar file before refresh. ERROR: %d: %s\n%s"), errno, _tcserror(errno), pai->filename);
showpopup(m_tszUserName, error, GG_POPUP_ERROR);
}
setString(pai->hContact, GG_KEY_AVATARHASH, AvatarHash);
@@ -255,7 +255,7 @@ INT_PTR GGPROTO::getavatarinfo(WPARAM wParam, LPARAM lParam) if (_tremove(pai->filename) != 0){
debugLog(_T("getavatarinfo(): delete. _tremove file %s error. errno=%d: %s"), pai->filename, errno, strerror(errno));
TCHAR error[512];
- mir_sntprintf(error, SIZEOF(error), TranslateT("Cannot remove old avatar file. ERROR: %d: %s\n%s"), errno, _tcserror(errno), pai->filename);
+ mir_sntprintf(error, TranslateT("Cannot remove old avatar file. ERROR: %d: %s\n%s"), errno, _tcserror(errno), pai->filename);
showpopup(m_tszUserName, error, GG_POPUP_ERROR);
}
delSetting(pai->hContact, GG_KEY_AVATARHASH);
diff --git a/protocols/Gadu-Gadu/src/sessions.cpp b/protocols/Gadu-Gadu/src/sessions.cpp index b1625f4471..07ee15a443 100644 --- a/protocols/Gadu-Gadu/src/sessions.cpp +++ b/protocols/Gadu-Gadu/src/sessions.cpp @@ -330,7 +330,7 @@ static INT_PTR CALLBACK gg_sessions_viewdlg(HWND hwndDlg, UINT message, WPARAM w ListView_GetItemText(hList, lvhti.iItem, 0, szClientName, SIZEOF(szClientName));
ListView_GetItemText(hList, lvhti.iItem, 1, szIP, SIZEOF(szIP));
ListView_GetItemText(hList, lvhti.iItem, 2, szLoginTime, SIZEOF(szLoginTime));
- mir_sntprintf(szText, SIZEOF(szText), _T("%s\t%s\t%s"), szClientName, szIP, szLoginTime);
+ mir_sntprintf(szText, _T("%s\t%s\t%s"), szClientName, szIP, szLoginTime);
if ((hData = GlobalAlloc(GMEM_MOVEABLE, mir_tstrlen(szText) + 1)) != NULL)
{
mir_tstrcpy((TCHAR*)GlobalLock(hData), szText);
diff --git a/protocols/Gadu-Gadu/src/token.cpp b/protocols/Gadu-Gadu/src/token.cpp index 2fcf36d31d..11f72ef8ce 100644 --- a/protocols/Gadu-Gadu/src/token.cpp +++ b/protocols/Gadu-Gadu/src/token.cpp @@ -117,7 +117,7 @@ int GGPROTO::gettoken(GGTOKEN *token) if (!(h = gg_token(0)) || gg_token_watch_fd(h) || h->state == GG_STATE_ERROR || h->state != GG_STATE_DONE) {
TCHAR error[128];
- mir_sntprintf(error, SIZEOF(error), TranslateT("Token retrieval failed because of error:\n\t%s"), http_error_string(h ? h->error : 0));
+ mir_sntprintf(error, TranslateT("Token retrieval failed because of error:\n\t%s"), http_error_string(h ? h->error : 0));
MessageBox(NULL, error, m_tszUserName, MB_OK | MB_ICONSTOP);
gg_free_pubdir(h);
return FALSE;
@@ -125,7 +125,7 @@ int GGPROTO::gettoken(GGTOKEN *token) if (!(t = (struct gg_token *)h->data) || (!h->body)) {
TCHAR error[128];
- mir_sntprintf(error, SIZEOF(error), TranslateT("Token retrieval failed because of error:\n\t%s"), http_error_string(h ? h->error : 0));
+ mir_sntprintf(error, TranslateT("Token retrieval failed because of error:\n\t%s"), http_error_string(h ? h->error : 0));
MessageBox(NULL, error, m_tszUserName, MB_OK | MB_ICONSTOP);
gg_free_pubdir(h);
return FALSE;
diff --git a/protocols/Gadu-Gadu/src/userutils.cpp b/protocols/Gadu-Gadu/src/userutils.cpp index a5fcae5ee3..ec4441b2a3 100644 --- a/protocols/Gadu-Gadu/src/userutils.cpp +++ b/protocols/Gadu-Gadu/src/userutils.cpp @@ -40,7 +40,7 @@ void *gg_doregister(GGPROTO *gg, char *newPass, char *newEmail) if (!(h = gg_register3(newEmail, newPass, token.id, token.val, 0)) || !(s = (gg_pubdir*)h->data) || !s->success || !s->uin) {
TCHAR error[128];
- mir_sntprintf(error, SIZEOF(error), TranslateT("Cannot register new account because of error:\n\t%s"),
+ mir_sntprintf(error, TranslateT("Cannot register new account because of error:\n\t%s"),
(h && !s) ? http_error_string(h ? h->error : 0) :
(s ? TranslateT("Registration rejected") : _tcserror(errno)));
MessageBox(NULL, error, gg->m_tszUserName, MB_OK | MB_ICONSTOP);
@@ -85,7 +85,7 @@ void *gg_dounregister(GGPROTO *gg, uin_t uin, char *password) if (!(h = gg_unregister3(uin, password, token.id, token.val, 0)) || !(s = (gg_pubdir*)h->data) || !s->success || s->uin != uin)
{
TCHAR error[128];
- mir_sntprintf(error, SIZEOF(error), TranslateT("Your account cannot be removed because of error:\n\t%s"),
+ mir_sntprintf(error, TranslateT("Your account cannot be removed because of error:\n\t%s"),
(h && !s) ? http_error_string(h ? h->error : 0) :
(s ? TranslateT("Bad number or password") : _tcserror(errno)));
MessageBox(NULL, error, gg->m_tszUserName, MB_OK | MB_ICONSTOP);
@@ -137,7 +137,7 @@ void *gg_dochpass(GGPROTO *gg, uin_t uin, char *password, char *newPass) if (!(h = gg_change_passwd4(uin, email, password, newPass, token.id, token.val, 0)) || !(s = (gg_pubdir*)h->data) || !s->success)
{
TCHAR error[128];
- mir_sntprintf(error, SIZEOF(error), TranslateT("Your password cannot be changed because of error:\n\t%s"),
+ mir_sntprintf(error, TranslateT("Your password cannot be changed because of error:\n\t%s"),
(h && !s) ? http_error_string(h ? h->error : 0) :
(s ? TranslateT("Invalid data entered") : _tcserror(errno)));
MessageBox(NULL, error, gg->m_tszUserName, MB_OK | MB_ICONSTOP);
@@ -179,7 +179,7 @@ void *gg_dochemail(GGPROTO *gg, uin_t uin, char *password, char *email, char *ne if (!(h = gg_change_passwd4(uin, newEmail, password, password, token.id, token.val, 0)) || !(s = (gg_pubdir*)h->data) || !s->success)
{
TCHAR error[128];
- mir_sntprintf(error, SIZEOF(error), TranslateT("Your e-mail cannot be changed because of error:\n\t%s"),
+ mir_sntprintf(error, TranslateT("Your e-mail cannot be changed because of error:\n\t%s"),
(h && !s) ? http_error_string(h ? h->error : 0) : (s ? TranslateT("Bad old e-mail or password") : _tcserror(errno)));
MessageBox(NULL, error, gg->m_tszUserName, MB_OK | MB_ICONSTOP);
gg->debugLogA("gg_dochemail(): Cannot change e-mail. errno=%d: %s", errno, strerror(errno));
diff --git a/protocols/IRCG/src/commandmonitor.cpp b/protocols/IRCG/src/commandmonitor.cpp index e6cdea96ee..a5b3f359be 100644 --- a/protocols/IRCG/src/commandmonitor.cpp +++ b/protocols/IRCG/src/commandmonitor.cpp @@ -530,7 +530,7 @@ bool CIrcProto::OnIrc_MODE(const CIrcMessage* pmsg) if (m_oldStyleModes) {
TCHAR temp[256];
- mir_sntprintf(temp, SIZEOF(temp), TranslateT("%s sets mode %s"),
+ mir_sntprintf(temp, TranslateT("%s sets mode %s"),
pmsg->prefix.sNick.c_str(), pmsg->parameters[1].c_str());
CMString sMessage = temp;
@@ -544,7 +544,7 @@ bool CIrcProto::OnIrc_MODE(const CIrcMessage* pmsg) sParams += _T(" ") + pmsg->parameters[i];
TCHAR temp[4000];
- mir_sntprintf(temp, SIZEOF(temp), TranslateT("%s sets mode %s%s"), pmsg->prefix.sNick.c_str(), sModes.c_str(), sParams.c_str());
+ mir_sntprintf(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);
}
@@ -553,7 +553,7 @@ bool CIrcProto::OnIrc_MODE(const CIrcMessage* pmsg) }
else {
TCHAR temp[256];
- mir_sntprintf(temp, SIZEOF(temp), TranslateT("%s sets mode %s"), pmsg->prefix.sNick.c_str(), pmsg->parameters[1].c_str());
+ mir_sntprintf(temp, TranslateT("%s sets mode %s"), pmsg->prefix.sNick.c_str(), pmsg->parameters[1].c_str());
CMString sMessage = temp;
for (int i = 2; i < (int)pmsg->parameters.getCount(); i++)
@@ -741,7 +741,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg) // exploit???
if (mess.Find(1) != -1 || mess.Find(_T("%newl")) != -1) {
TCHAR temp[4096];
- mir_sntprintf(temp, SIZEOF(temp), TranslateT("CTCP ERROR: Malformed CTCP command received from %s!%s@%s. Possible attempt to take control of your IRC client registered"), pmsg->prefix.sNick.c_str(), pmsg->prefix.sUser.c_str(), pmsg->prefix.sHost.c_str());
+ mir_sntprintf(temp, TranslateT("CTCP ERROR: Malformed CTCP command received from %s!%s@%s. Possible attempt to take control of your IRC client registered"), pmsg->prefix.sNick.c_str(), pmsg->prefix.sUser.c_str(), pmsg->prefix.sHost.c_str());
DoEvent(GC_EVENT_INFORMATION, 0, m_info.sNick.c_str(), temp, NULL, NULL, NULL, true, false);
return true;
}
@@ -799,7 +799,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg) PostIrcMessage(_T("/NOTICE %s \001FINGER %s (%s)\001"), pmsg->prefix.sNick.c_str(), m_name, m_userID);
TCHAR temp[300];
- mir_sntprintf(temp, SIZEOF(temp), TranslateT("CTCP FINGER requested by %s"), pmsg->prefix.sNick.c_str());
+ mir_sntprintf(temp, TranslateT("CTCP FINGER requested by %s"), pmsg->prefix.sNick.c_str());
DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, NULL, temp, NULL, NULL, NULL, true, false);
}
@@ -808,7 +808,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg) PostIrcMessage(_T("/NOTICE %s \001VERSION Miranda NG %%mirver (IRC v.%%version), (c) 2003-2014 J.Persson, G.Hazan\001"), pmsg->prefix.sNick.c_str());
TCHAR temp[300];
- mir_sntprintf(temp, SIZEOF(temp), TranslateT("CTCP VERSION requested by %s"), pmsg->prefix.sNick.c_str());
+ mir_sntprintf(temp, TranslateT("CTCP VERSION requested by %s"), pmsg->prefix.sNick.c_str());
DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, NULL, temp, NULL, NULL, NULL, true, false);
}
@@ -817,7 +817,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg) PostIrcMessage(_T("/NOTICE %s \001SOURCE Get Miranda IRC here: http://miranda-ng.org/ \001"), pmsg->prefix.sNick.c_str());
TCHAR temp[300];
- mir_sntprintf(temp, SIZEOF(temp), TranslateT("CTCP SOURCE requested by %s"), pmsg->prefix.sNick.c_str());
+ mir_sntprintf(temp, TranslateT("CTCP SOURCE requested by %s"), pmsg->prefix.sNick.c_str());
DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, NULL, temp, NULL, NULL, NULL, true, false);
}
@@ -826,7 +826,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg) PostIrcMessage(_T("/NOTICE %s \001USERINFO %s\001"), pmsg->prefix.sNick.c_str(), m_userInfo);
TCHAR temp[300];
- mir_sntprintf(temp, SIZEOF(temp), TranslateT("CTCP USERINFO requested by %s"), pmsg->prefix.sNick.c_str());
+ mir_sntprintf(temp, TranslateT("CTCP USERINFO requested by %s"), pmsg->prefix.sNick.c_str());
DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, NULL, temp, NULL, NULL, NULL, true, false);
}
@@ -835,7 +835,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg) PostIrcMessage(_T("/NOTICE %s \001%s\001"), pmsg->prefix.sNick.c_str(), mess.c_str());
TCHAR temp[300];
- mir_sntprintf(temp, SIZEOF(temp), TranslateT("CTCP PING requested by %s"), pmsg->prefix.sNick.c_str());
+ mir_sntprintf(temp, TranslateT("CTCP PING requested by %s"), pmsg->prefix.sNick.c_str());
DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, NULL, temp, NULL, NULL, NULL, true, false);
}
@@ -846,7 +846,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg) mir_tstrncpy(temp, _tctime(&tim), 25);
PostIrcMessage(_T("/NOTICE %s \001TIME %s\001"), pmsg->prefix.sNick.c_str(), temp);
- mir_sntprintf(temp, SIZEOF(temp), TranslateT("CTCP TIME requested by %s"), pmsg->prefix.sNick.c_str());
+ mir_sntprintf(temp, TranslateT("CTCP TIME requested by %s"), pmsg->prefix.sNick.c_str());
DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, NULL, temp, NULL, NULL, NULL, true, false);
}
@@ -1014,16 +1014,16 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg) ulAdr = ConvertIPToInteger(m_IPFromServer ? m_myHost : m_myLocalHost);
if (bIsChat && !m_DCCChatEnabled)
- mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("DCC: Chat request from %s denied"), pmsg->prefix.sNick.c_str());
+ mir_sntprintf(szTemp, TranslateT("DCC: Chat request from %s denied"), pmsg->prefix.sNick.c_str());
else if (type == _T("send") && !m_DCCFileEnabled)
- mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("DCC: File transfer request from %s denied"), pmsg->prefix.sNick.c_str());
+ mir_sntprintf(szTemp, TranslateT("DCC: File transfer request from %s denied"), pmsg->prefix.sNick.c_str());
else if (type == _T("send") && !iPort && ulAdr == 0)
- mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("DCC: Reverse file transfer request from %s denied [No local IP]"), pmsg->prefix.sNick.c_str());
+ mir_sntprintf(szTemp, TranslateT("DCC: Reverse file transfer request from %s denied [No local IP]"), pmsg->prefix.sNick.c_str());
if (sFile.IsEmpty() || dwAdr == 0 || dwSize == 0 || iPort == 0 && sToken.IsEmpty())
- mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("DCC ERROR: Malformed CTCP request from %s [%s]"), pmsg->prefix.sNick.c_str(), mess.c_str());
+ mir_sntprintf(szTemp, TranslateT("DCC ERROR: Malformed CTCP request from %s [%s]"), pmsg->prefix.sNick.c_str(), mess.c_str());
if (szTemp[0]) {
DoEvent(GC_EVENT_INFORMATION, 0, m_info.sNick.c_str(), szTemp, NULL, NULL, NULL, true, false);
@@ -1042,10 +1042,10 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg) szTemp[0] = '\0';
if (type == _T("resume") && !m_DCCFileEnabled)
- mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("DCC: File transfer resume request from %s denied"), pmsg->prefix.sNick.c_str());
+ mir_sntprintf(szTemp, TranslateT("DCC: File transfer resume request from %s denied"), pmsg->prefix.sNick.c_str());
if (sToken.IsEmpty() && iPort == 0 || sFile.IsEmpty())
- mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("DCC ERROR: Malformed CTCP request from %s [%s]"), pmsg->prefix.sNick.c_str(), mess.c_str());
+ mir_sntprintf(szTemp, TranslateT("DCC ERROR: Malformed CTCP request from %s [%s]"), pmsg->prefix.sNick.c_str(), mess.c_str());
if (szTemp[0]) {
DoEvent(GC_EVENT_INFORMATION, 0, m_info.sNick.c_str(), szTemp, NULL, NULL, NULL, true, false);
@@ -1077,7 +1077,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg) }
else {
TCHAR szTemp[512];
- mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("DCC: Chat request from %s denied"), pmsg->prefix.sNick.c_str());
+ mir_sntprintf(szTemp, TranslateT("DCC: Chat request from %s denied"), pmsg->prefix.sNick.c_str());
DoEvent(GC_EVENT_INFORMATION, 0, m_info.sNick.c_str(), szTemp, NULL, NULL, NULL, true, false);
}
}
@@ -1174,7 +1174,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg) }
else if (pmsg->m_bIncoming) {
TCHAR temp[300];
- mir_sntprintf(temp, SIZEOF(temp), TranslateT("CTCP %s requested by %s"), ocommand.c_str(), pmsg->prefix.sNick.c_str());
+ mir_sntprintf(temp, TranslateT("CTCP %s requested by %s"), ocommand.c_str(), pmsg->prefix.sNick.c_str());
DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, NULL, temp, NULL, NULL, NULL, true, false);
}
}
@@ -1206,9 +1206,9 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg) int s = (int)time(0) - (int)_ttol(GetWordAddress(mess.c_str(), 1));
TCHAR szTemp[30];
if (s == 1)
- mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%u second"), s);
+ mir_sntprintf(szTemp, _T("%u second"), s);
else
- mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%u seconds"), s);
+ mir_sntprintf(szTemp, _T("%u seconds"), s);
m_whoisDlg->m_Reply.SetText(DoColorCodes(szTemp, TRUE, FALSE));
return true;
@@ -1219,11 +1219,11 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg) //... else show the reply in the current window
if (pmsg->m_bIncoming && command == _T("ping")) {
int s = (int)time(0) - (int)_ttol(GetWordAddress(mess.c_str(), 1));
- mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("CTCP PING reply from %s: %u sec(s)"), pmsg->prefix.sNick.c_str(), s);
+ mir_sntprintf(szTemp, TranslateT("CTCP PING reply from %s: %u sec(s)"), pmsg->prefix.sNick.c_str(), s);
DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, NULL, szTemp, NULL, NULL, NULL, true, false);
}
else {
- mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("CTCP %s reply from %s: %s"), ocommand.c_str(), pmsg->prefix.sNick.c_str(), GetWordAddress(mess.c_str(), 1));
+ mir_sntprintf(szTemp, TranslateT("CTCP %s reply from %s: %s"), ocommand.c_str(), pmsg->prefix.sNick.c_str(), GetWordAddress(mess.c_str(), 1));
DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, NULL, szTemp, NULL, NULL, NULL, true, false);
}
}
@@ -1542,9 +1542,9 @@ bool CIrcProto::OnIrc_LIST(const CIrcMessage* pmsg) TCHAR text[100];
if (percent < 100)
- mir_sntprintf(text, SIZEOF(text), TranslateT("Downloading list (%u%%) - %u channels"), percent, m_channelNumber);
+ mir_sntprintf(text, TranslateT("Downloading list (%u%%) - %u channels"), percent, m_channelNumber);
else
- mir_sntprintf(text, SIZEOF(text), TranslateT("Downloading list - %u channels"), m_channelNumber);
+ mir_sntprintf(text, TranslateT("Downloading list - %u channels"), m_channelNumber);
m_listDlg->m_status.SetText(text);
}
@@ -1562,7 +1562,7 @@ bool CIrcProto::OnIrc_LISTEND(const CIrcMessage* pmsg) m_listDlg->UpdateList();
TCHAR text[100];
- mir_sntprintf(text, SIZEOF(text), TranslateT("Done: %u channels"), m_channelNumber);
+ mir_sntprintf(text, TranslateT("Done: %u channels"), m_channelNumber);
int percent = 100;
if (m_noOfChannels > 0)
percent = (int)(m_channelNumber * 100) / m_noOfChannels;
@@ -1712,13 +1712,13 @@ bool CIrcProto::OnIrc_WHOIS_IDLE(const CIrcMessage* pmsg) TCHAR temp[100];
if (D)
- mir_sntprintf(temp, SIZEOF(temp), TranslateT("%ud, %uh, %um, %us"), D, H, M, S);
+ mir_sntprintf(temp, TranslateT("%ud, %uh, %um, %us"), D, H, M, S);
else if (H)
- mir_sntprintf(temp, SIZEOF(temp), TranslateT("%uh, %um, %us"), H, M, S);
+ mir_sntprintf(temp, TranslateT("%uh, %um, %us"), H, M, S);
else if (M)
- mir_sntprintf(temp, SIZEOF(temp), TranslateT("%um, %us"), M, S);
+ mir_sntprintf(temp, TranslateT("%um, %us"), M, S);
else if (S)
- mir_sntprintf(temp, SIZEOF(temp), TranslateT("%us"), S);
+ mir_sntprintf(temp, TranslateT("%us"), S);
else
temp[0] = 0;
diff --git a/protocols/IRCG/src/input.cpp b/protocols/IRCG/src/input.cpp index 2d8a84dd97..098c8d1171 100644 --- a/protocols/IRCG/src/input.cpp +++ b/protocols/IRCG/src/input.cpp @@ -310,7 +310,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR* window, MCONTACT hConta AddIgnore(one.c_str(), IgnoreFlags.c_str(), m_network.c_str());
- mir_sntprintf(temp, SIZEOF(temp), TranslateT("%s on %s is now ignored (+%s)"), one.c_str(), m_network.c_str(), IgnoreFlags.c_str());
+ mir_sntprintf(temp, TranslateT("%s on %s is now ignored (+%s)"), one.c_str(), m_network.c_str(), IgnoreFlags.c_str());
DoEvent(GC_EVENT_INFORMATION, NULL, m_info.sNick.c_str(), temp, NULL, NULL, NULL, true, false);
}
return true;
@@ -322,9 +322,9 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR* window, MCONTACT hConta TCHAR temp[500];
if (RemoveIgnore(one.c_str()))
- mir_sntprintf(temp, SIZEOF(temp), TranslateT("%s is not ignored now"), one.c_str());
+ mir_sntprintf(temp, TranslateT("%s is not ignored now"), one.c_str());
else
- mir_sntprintf(temp, SIZEOF(temp), TranslateT("%s was not ignored"), one.c_str());
+ mir_sntprintf(temp, TranslateT("%s was not ignored"), one.c_str());
DoEvent(GC_EVENT_INFORMATION, NULL, m_info.sNick.c_str(), temp, NULL, NULL, NULL, true, false);
return true;
}
@@ -375,7 +375,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR* window, MCONTACT hConta gci.pszModule = m_szModuleName;
gci.pszID = S.c_str();
if (!CallServiceSync(MS_GC_GETINFO, 0, (LPARAM)&gci))
- mir_sntprintf(szTemp, SIZEOF(szTemp), _T("users: %u"), gci.iCount);
+ mir_sntprintf(szTemp, _T("users: %u"), gci.iCount);
DoEvent(GC_EVENT_INFORMATION, NULL, m_info.sNick.c_str(), szTemp, NULL, NULL, NULL, true, false);
return true;
@@ -425,7 +425,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR* window, MCONTACT hConta DoEvent(GC_EVENT_INFORMATION, NULL, m_info.sNick.c_str(), TranslateT("The time interval for the buddy check function is now at default setting"), NULL, NULL, NULL, true, false);
else {
TCHAR temp[200];
- mir_sntprintf(temp, SIZEOF(temp), TranslateT("The time interval for the buddy check function is now %u seconds"), m_iTempCheckTime);
+ mir_sntprintf(temp, TranslateT("The time interval for the buddy check function is now %u seconds"), m_iTempCheckTime);
DoEvent(GC_EVENT_INFORMATION, NULL, m_info.sNick.c_str(), temp, NULL, NULL, NULL, true, false);
}
}
@@ -499,7 +499,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR* window, MCONTACT hConta int minutes2 = (int)m_noOfChannels / 9000;
TCHAR text[256];
- mir_sntprintf(text, SIZEOF(text), TranslateT("This command is not recommended on a network of this size!\r\nIt will probably cause high CPU usage and/or high bandwidth\r\nusage for around %u to %u minute(s).\r\n\r\nDo you want to continue?"), minutes2, minutes);
+ mir_sntprintf(text, TranslateT("This command is not recommended on a network of this size!\r\nIt will probably cause high CPU usage and/or high bandwidth\r\nusage for around %u to %u minute(s).\r\n\r\nDo you want to continue?"), minutes2, minutes);
if (m_noOfChannels < 4000 || (m_noOfChannels >= 4000 && MessageBox(NULL, text, TranslateT("IRC warning"), MB_YESNO | MB_ICONWARNING | MB_DEFBUTTON2) == IDYES)) {
ListView_DeleteAllItems(GetDlgItem(m_listDlg->GetHwnd(), IDC_INFO_LISTVIEW));
PostIrcMessage(_T("/lusers"));
@@ -514,7 +514,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR* window, MCONTACT hConta return true;
TCHAR szTemp[4000];
- mir_sntprintf(szTemp, SIZEOF(szTemp), _T("\001ACTION %s\001"), GetWordAddress(text.c_str(), 1));
+ mir_sntprintf(szTemp, _T("\001ACTION %s\001"), GetWordAddress(text.c_str(), 1));
PostIrcMessageWnd(window, hContact, szTemp);
return true;
}
@@ -544,7 +544,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR* window, MCONTACT hConta return true;
TCHAR szTemp[4000];
- mir_sntprintf(szTemp, SIZEOF(szTemp), _T("/PRIVMSG %s"), GetWordAddress(text.c_str(), 1));
+ mir_sntprintf(szTemp, _T("/PRIVMSG %s"), GetWordAddress(text.c_str(), 1));
PostIrcMessageWnd(window, hContact, szTemp);
return true;
@@ -579,7 +579,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR* window, MCONTACT hConta if (!two.IsEmpty()) {
TCHAR szTemp[4000];
- mir_sntprintf(szTemp, SIZEOF(szTemp), _T("/PRIVMSG %s"), GetWordAddress(text.c_str(), 1));
+ mir_sntprintf(szTemp, _T("/PRIVMSG %s"), GetWordAddress(text.c_str(), 1));
PostIrcMessageWnd(window, hContact, szTemp);
}
return true;
@@ -599,14 +599,14 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR* window, MCONTACT hConta // if it is not dcc or if it is dcc and a local ip exist
if (mir_tstrcmpi(two.c_str(), _T("dcc")) != 0 || ulAdr) {
if (mir_tstrcmpi(two.c_str(), _T("ping")) == 0)
- mir_sntprintf(szTemp, SIZEOF(szTemp), _T("/PRIVMSG %s \001%s %u\001"), one.c_str(), two.c_str(), time(0));
+ mir_sntprintf(szTemp, _T("/PRIVMSG %s \001%s %u\001"), one.c_str(), two.c_str(), time(0));
else
- mir_sntprintf(szTemp, SIZEOF(szTemp), _T("/PRIVMSG %s \001%s\001"), one.c_str(), GetWordAddress(text.c_str(), 2));
+ mir_sntprintf(szTemp, _T("/PRIVMSG %s \001%s\001"), one.c_str(), GetWordAddress(text.c_str(), 2));
PostIrcMessageWnd(window, hContact, szTemp);
}
if (mir_tstrcmpi(two.c_str(), _T("dcc")) != 0) {
- mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("CTCP %s request sent to %s"), two.c_str(), one.c_str());
+ mir_sntprintf(szTemp, TranslateT("CTCP %s request sent to %s"), two.c_str(), one.c_str());
DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, m_info.sNick.c_str(), szTemp, NULL, NULL, NULL, true, false);
}
@@ -661,7 +661,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR* window, MCONTACT hConta }
}
else {
- mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("DCC ERROR: Unable to automatically resolve external IP"));
+ mir_sntprintf(szTemp, TranslateT("DCC ERROR: Unable to automatically resolve external IP"));
DoEvent(GC_EVENT_INFORMATION, 0, m_info.sNick.c_str(), szTemp, NULL, NULL, NULL, true, false);
}
return true;
@@ -700,16 +700,16 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR* window, MCONTACT hConta if (iPort != 0) {
PostIrcMessage(_T("/CTCP %s DCC CHAT chat %u %u"), two.c_str(), ulAdr, iPort);
- mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("DCC CHAT request sent to %s"), two.c_str(), one.c_str());
+ mir_sntprintf(szTemp, TranslateT("DCC CHAT request sent to %s"), two.c_str(), one.c_str());
DoEvent(GC_EVENT_INFORMATION, 0, m_info.sNick.c_str(), szTemp, NULL, NULL, NULL, true, false);
}
else {
- mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("DCC ERROR: Unable to bind port"));
+ mir_sntprintf(szTemp, TranslateT("DCC ERROR: Unable to bind port"));
DoEvent(GC_EVENT_INFORMATION, 0, m_info.sNick.c_str(), szTemp, NULL, NULL, NULL, true, false);
}
}
else {
- mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("DCC ERROR: Unable to automatically resolve external IP"));
+ mir_sntprintf(szTemp, TranslateT("DCC ERROR: Unable to automatically resolve external IP"));
DoEvent(GC_EVENT_INFORMATION, 0, m_info.sNick.c_str(), szTemp, NULL, NULL, NULL, true, false);
}
}
diff --git a/protocols/IRCG/src/irclib.cpp b/protocols/IRCG/src/irclib.cpp index ca3f4aea60..4b2b74112d 100644 --- a/protocols/IRCG/src/irclib.cpp +++ b/protocols/IRCG/src/irclib.cpp @@ -201,7 +201,7 @@ bool CIrcProto::Connect(const CIrcSessionInfo& info) con = (HANDLE)CallService(MS_NETLIB_OPENCONNECTION, (WPARAM)m_hNetlibUser, (LPARAM)&ncon); if (con == NULL) { TCHAR szTemp[300]; - mir_sntprintf(szTemp, SIZEOF(szTemp), _T("\0035%s \002%s\002 (%S: %u)."), + mir_sntprintf(szTemp, _T("\0035%s \002%s\002 (%S: %u)."), TranslateT("Failed to connect to"), si.sNetwork.c_str(), si.sServer.c_str(), si.iPort); DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, NULL, szTemp, NULL, NULL, NULL, true, false); return false; diff --git a/protocols/IRCG/src/ircproto.cpp b/protocols/IRCG/src/ircproto.cpp index aa744eb914..a29b5c9a6d 100644 --- a/protocols/IRCG/src/ircproto.cpp +++ b/protocols/IRCG/src/ircproto.cpp @@ -224,7 +224,7 @@ int CIrcProto::OnModulesLoaded(WPARAM, LPARAM) CallChatEvent(WINDOW_HIDDEN, (LPARAM)&gce);
TCHAR szTemp[MAX_PATH];
- mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%%miranda_path%%\\Plugins\\%S_perform.ini"), m_szModuleName);
+ mir_sntprintf(szTemp, _T("%%miranda_path%%\\Plugins\\%S_perform.ini"), m_szModuleName);
TCHAR *szLoadFileName = Utils_ReplaceVarsT(szTemp);
char* pszPerformData = IrcLoadFile(szLoadFileName);
if (pszPerformData != NULL) {
@@ -595,13 +595,13 @@ HANDLE __cdecl CIrcProto::SendFile(MCONTACT hContact, const TCHAR*, TCHAR** ppsz PostIrcMessage(_T("/CTCP %s DCC SEND %s 200 0 %I64u %u"),
dci->sContactName.c_str(), sFileWithQuotes.c_str(), dci->dwSize, dcc->iToken);
- mir_sntprintf(szTemp, SIZEOF(szTemp),
+ mir_sntprintf(szTemp,
TranslateT("DCC reversed file transfer request sent to %s [%s]"),
dci->sContactName.c_str(), sFileCorrect.c_str());
DoEvent(GC_EVENT_INFORMATION, 0, m_info.sNick.c_str(), szTemp, NULL, NULL, NULL, true, false);
if (m_sendNotice) {
- mir_sntprintf(szTemp, SIZEOF(szTemp),
+ mir_sntprintf(szTemp,
_T("/NOTICE %s I am sending the file '\002%s\002' (%I64u kB) to you, please accept it. [Reverse transfer]"),
dci->sContactName.c_str(), sFileCorrect.c_str(), dci->dwSize / 1024);
PostIrcMessage(szTemp);
@@ -614,13 +614,13 @@ HANDLE __cdecl CIrcProto::SendFile(MCONTACT hContact, const TCHAR*, TCHAR** ppsz PostIrcMessage(_T("/CTCP %s DCC SEND %s %u %u %I64u"),
dci->sContactName.c_str(), sFileWithQuotes.c_str(), ulAdr, iPort, dci->dwSize);
- mir_sntprintf(szTemp, SIZEOF(szTemp),
+ mir_sntprintf(szTemp,
TranslateT("DCC file transfer request sent to %s [%s]"),
dci->sContactName.c_str(), sFileCorrect.c_str());
DoEvent(GC_EVENT_INFORMATION, 0, m_info.sNick.c_str(), szTemp, NULL, NULL, NULL, true, false);
if (m_sendNotice) {
- mir_sntprintf(szTemp, SIZEOF(szTemp),
+ mir_sntprintf(szTemp,
_T("/NOTICE %s I am sending the file '\002%s\002' (%I64u kB) to you, please accept it. [IP: %s]"),
dci->sContactName.c_str(), sFileCorrect.c_str(), dci->dwSize / 1024, (TCHAR*)_A2T(ConvertIntegerToIP(ulAdr)));
PostIrcMessage(szTemp);
diff --git a/protocols/IRCG/src/options.cpp b/protocols/IRCG/src/options.cpp index 24f51da361..5bd7ac5427 100644 --- a/protocols/IRCG/src/options.cpp +++ b/protocols/IRCG/src/options.cpp @@ -620,7 +620,7 @@ void CConnectPrefsDlg::OnDeleteServer(CCtrlButton*) SERVER_INFO *pData = (SERVER_INFO*)m_serverCombo.GetItemData(i);
TCHAR temp[200];
- mir_sntprintf(temp, SIZEOF(temp), TranslateT("Do you want to delete\r\n%s"), (TCHAR*)_A2T(pData->m_name));
+ mir_sntprintf(temp, TranslateT("Do you want to delete\r\n%s"), (TCHAR*)_A2T(pData->m_name));
if (MessageBox(m_hwnd, temp, TranslateT("Delete server"), MB_YESNO | MB_ICONQUESTION) == IDYES) {
g_servers.remove(pData);
@@ -850,7 +850,7 @@ void CCtcpPrefsDlg::OnInitDialog() m_combo.AddStringA("8192");
TCHAR szTemp[10];
- mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%u"), m_proto->m_DCCPacketSize);
+ mir_sntprintf(szTemp, _T("%u"), m_proto->m_DCCPacketSize);
int i = m_combo.SelectString(szTemp);
if (i == CB_ERR)
m_combo.SelectString(_T("4096"));
@@ -1338,7 +1338,7 @@ static LRESULT CALLBACK ListviewSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, void CIrcProto::InitIgnore(void)
{
TCHAR szTemp[MAX_PATH];
- mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%%miranda_path%%\\Plugins\\%S_ignore.ini"), m_szModuleName);
+ mir_sntprintf(szTemp, _T("%%miranda_path%%\\Plugins\\%S_ignore.ini"), m_szModuleName);
TCHAR *szLoadFileName = Utils_ReplaceVarsT(szTemp);
char* pszIgnoreData = IrcLoadFile(szLoadFileName);
if (pszIgnoreData != NULL) {
diff --git a/protocols/IRCG/src/output.cpp b/protocols/IRCG/src/output.cpp index 94eae7e12d..c86d78fb61 100644 --- a/protocols/IRCG/src/output.cpp +++ b/protocols/IRCG/src/output.cpp @@ -28,7 +28,7 @@ static CMString FormatOutput(const CIrcMessage* pmsg) if (pmsg->m_bIncoming) { // Is it an incoming message?
if (pmsg->sCommand == _T("WALLOPS") && pmsg->parameters.getCount() > 0) {
TCHAR temp[200]; *temp = '\0';
- mir_sntprintf(temp, SIZEOF(temp), TranslateT("WallOps from %s: "), pmsg->prefix.sNick.c_str());
+ mir_sntprintf(temp, TranslateT("WallOps from %s: "), pmsg->prefix.sNick.c_str());
sMessage = temp;
for (int i = 0; i < (int)pmsg->parameters.getCount(); i++) {
sMessage += pmsg->parameters[i];
@@ -40,7 +40,7 @@ static CMString FormatOutput(const CIrcMessage* pmsg) if (pmsg->sCommand == _T("INVITE") && pmsg->parameters.getCount() > 1) {
TCHAR temp[256]; *temp = '\0';
- mir_sntprintf(temp, SIZEOF(temp), TranslateT("%s invites you to %s"), pmsg->prefix.sNick.c_str(), pmsg->parameters[1].c_str());
+ mir_sntprintf(temp, TranslateT("%s invites you to %s"), pmsg->prefix.sNick.c_str(), pmsg->parameters[1].c_str());
sMessage = temp;
for (int i = 2; i < (int)pmsg->parameters.getCount(); i++) {
sMessage += _T(": ") + pmsg->parameters[i];
@@ -53,7 +53,7 @@ static CMString FormatOutput(const CIrcMessage* pmsg) int index = _ttoi(pmsg->sCommand.c_str());
if (index == 301 && pmsg->parameters.getCount() > 0) {
TCHAR temp[500]; *temp = '\0';
- mir_sntprintf(temp, SIZEOF(temp), TranslateT("%s is away"), pmsg->parameters[1].c_str());
+ mir_sntprintf(temp, TranslateT("%s is away"), pmsg->parameters[1].c_str());
sMessage = temp;
for (int i = 2; i < (int)pmsg->parameters.getCount(); i++) {
sMessage += _T(": ") + pmsg->parameters[i];
@@ -90,13 +90,13 @@ static CMString FormatOutput(const CIrcMessage* pmsg) tempstr.Delete(tempstr.GetLength() - 1, 1);
CMString type = GetWord(tempstr.c_str(), 0);
if (mir_tstrcmpi(type.c_str(), _T("ping")) == 0)
- mir_sntprintf(temp, SIZEOF(temp), TranslateT("CTCP %s reply sent to %s"), type.c_str(), pmsg->parameters[0].c_str());
+ mir_sntprintf(temp, TranslateT("CTCP %s reply sent to %s"), type.c_str(), pmsg->parameters[0].c_str());
else
- mir_sntprintf(temp, SIZEOF(temp), TranslateT("CTCP %s reply sent to %s: %s"), type.c_str(), pmsg->parameters[0].c_str(), GetWordAddress(tempstr.c_str(), 1));
+ mir_sntprintf(temp, TranslateT("CTCP %s reply sent to %s: %s"), type.c_str(), pmsg->parameters[0].c_str(), GetWordAddress(tempstr.c_str(), 1));
sMessage = temp;
}
else {
- mir_sntprintf(temp, SIZEOF(temp), TranslateT("Notice to %s: "), pmsg->parameters[0].c_str());
+ mir_sntprintf(temp, TranslateT("Notice to %s: "), pmsg->parameters[0].c_str());
sMessage = temp;
for (int i = 1; i < (int)pmsg->parameters.getCount(); i++) {
sMessage += pmsg->parameters[i];
diff --git a/protocols/IRCG/src/scripting.cpp b/protocols/IRCG/src/scripting.cpp index a88dbdbf4d..2082bad904 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, SIZEOF(szTemp), _T("%u"), gci.iCount);
+ mir_sntprintf(szTemp, _T("%u"), gci.iCount);
sOutput = szTemp;
}
}
diff --git a/protocols/IRCG/src/services.cpp b/protocols/IRCG/src/services.cpp index 2d77ee5f17..f90d18381f 100644 --- a/protocols/IRCG/src/services.cpp +++ b/protocols/IRCG/src/services.cpp @@ -199,7 +199,7 @@ INT_PTR __cdecl CIrcProto::OnDoubleclicked(WPARAM, LPARAM lParam) dlg->Show();
HWND hWnd = dlg->GetHwnd();
TCHAR szTemp[500];
- mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("%s (%s) is requesting a client-to-client chat connection."),
+ mir_sntprintf(szTemp, TranslateT("%s (%s) is requesting a client-to-client chat connection."),
pdci->sContactName.c_str(), pdci->sHostmask.c_str());
SetDlgItemText(hWnd, IDC_TEXT, szTemp);
ShowWindow(hWnd, SW_SHOW);
@@ -532,7 +532,7 @@ int __cdecl CIrcProto::GCEventHook(WPARAM, LPARAM lParam) case GC_USER_PRIVMESS:
{
TCHAR szTemp[4000];
- mir_sntprintf(szTemp, SIZEOF(szTemp), _T("/QUERY %s"), gch->ptszUID);
+ mir_sntprintf(szTemp, _T("/QUERY %s"), gch->ptszUID);
PostIrcMessageWnd(p1, NULL, szTemp);
}
break;
@@ -1069,7 +1069,7 @@ void CIrcProto::ConnectToServer(void) InterlockedIncrement((long *)&m_bConnectRequested);
TCHAR szTemp[300];
- mir_sntprintf(szTemp, SIZEOF(szTemp), _T("\033%s \002%s\002 (%S: %u)"),
+ mir_sntprintf(szTemp, _T("\033%s \002%s\002 (%S: %u)"),
TranslateT("Connecting to"), si.sNetwork.c_str(), si.sServer.c_str(), si.iPort);
DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, NULL, szTemp, NULL, NULL, NULL, true, false);
}
diff --git a/protocols/IRCG/src/tools.cpp b/protocols/IRCG/src/tools.cpp index 954665a01f..55dfc734f5 100644 --- a/protocols/IRCG/src/tools.cpp +++ b/protocols/IRCG/src/tools.cpp @@ -342,7 +342,7 @@ TCHAR* __stdcall DoColorCodes(const TCHAR* text, bool bStrip, bool bReplacePerce *p++ = '%';
*p++ = 'c';
- mir_sntprintf(buf, SIZEOF(buf), _T("%02u"), iFG);
+ mir_sntprintf(buf, _T("%02u"), iFG);
for (int i = 0; i < 2; i++)
*p++ = buf[i];
}
@@ -355,7 +355,7 @@ TCHAR* __stdcall DoColorCodes(const TCHAR* text, bool bStrip, bool bReplacePerce *p++ = '%';
*p++ = 'f';
- mir_sntprintf(buf, SIZEOF(buf), _T("%02u"), iBG);
+ mir_sntprintf(buf, _T("%02u"), iBG);
for (int i = 0; i < 2; i++)
*p++ = buf[i];
}
@@ -548,7 +548,7 @@ int CIrcProto::SetChannelSBText(CMString sWindow, CHANNELINFO * wi) CMString CIrcProto::MakeWndID(const TCHAR* sWindow)
{
TCHAR buf[200];
- mir_sntprintf(buf, SIZEOF(buf), _T("%s - %s"), sWindow, (IsConnected()) ? m_info.sNetwork.c_str() : TranslateT("Offline"));
+ mir_sntprintf(buf, _T("%s - %s"), sWindow, (IsConnected()) ? m_info.sNetwork.c_str() : TranslateT("Offline"));
return CMString(buf);
}
diff --git a/protocols/IRCG/src/windows.cpp b/protocols/IRCG/src/windows.cpp index 51accea275..0de5d3b1b7 100644 --- a/protocols/IRCG/src/windows.cpp +++ b/protocols/IRCG/src/windows.cpp @@ -923,7 +923,7 @@ void CManagerDlg::OnClose() }
if (!S.IsEmpty() && m_proto->IsConnected()) {
- mir_sntprintf(temp, SIZEOF(temp), _T("Topic%s%s"), window, m_proto->m_info.sNetwork.c_str());
+ mir_sntprintf(temp, _T("Topic%s%s"), window, m_proto->m_info.sNetwork.c_str());
char* p = mir_t2a(temp);
m_proto->setTString(p, S.c_str());
mir_free(p);
@@ -1189,9 +1189,9 @@ void CManagerDlg::OnApplyModes(CCtrlButton*) mir_tstrcat(temp, window);
mir_tstrcat(temp, _T(" "));
if (mir_tstrlen(toremove))
- mir_sntprintf(temp, SIZEOF(temp), _T("%s-%s"), temp, toremove);
+ mir_sntprintf(temp, _T("%s-%s"), temp, toremove);
if (mir_tstrlen(toadd))
- mir_sntprintf(temp, SIZEOF(temp), _T("%s+%s"), temp, toadd);
+ mir_sntprintf(temp, _T("%s+%s"), temp, toadd);
if (!appendixremove.IsEmpty())
mir_tstrcat(temp, appendixremove.c_str());
if (!appendixadd.IsEmpty())
@@ -1278,7 +1278,7 @@ void CManagerDlg::InitManager(int mode, const TCHAR* window) if (wi) {
if (m_proto->IsConnected()) {
TCHAR temp[1000];
- mir_sntprintf(temp, SIZEOF(temp), _T("Topic%s%s"), window, m_proto->m_info.sNetwork.c_str());
+ mir_sntprintf(temp, _T("Topic%s%s"), window, m_proto->m_info.sNetwork.c_str());
char* p = mir_t2a(temp);
diff --git a/protocols/IcqOscarJ/src/dlgproc.cpp b/protocols/IcqOscarJ/src/dlgproc.cpp index 041333468c..517463bfd8 100644 --- a/protocols/IcqOscarJ/src/dlgproc.cpp +++ b/protocols/IcqOscarJ/src/dlgproc.cpp @@ -475,7 +475,7 @@ INT_PTR CALLBACK ChangeInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM for (done = 0, i = 0; i < SIZEOF(dat->hUpload); i++)
done += dat->hUpload[i] == NULL;
TCHAR buf[MAX_PATH];
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("Upload in progress...%d%%"), 100 * done / (SIZEOF(dat->hUpload)));
+ mir_sntprintf(buf, TranslateT("Upload in progress...%d%%"), 100 * done / (SIZEOF(dat->hUpload)));
SetDlgItemText(hwndDlg, IDC_UPLOADING, buf);
if (done < SIZEOF(dat->hUpload)) break;
diff --git a/protocols/IcqOscarJ/src/icq_avatar.cpp b/protocols/IcqOscarJ/src/icq_avatar.cpp index 9e3e9ca250..bf14253fca 100644 --- a/protocols/IcqOscarJ/src/icq_avatar.cpp +++ b/protocols/IcqOscarJ/src/icq_avatar.cpp @@ -76,7 +76,7 @@ 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, SIZEOF(szPath), _T("%s\\%S\\"), VARST(_T("%miranda_avatarcache%")), m_szModuleName);
+ mir_sntprintf(szPath, _T("%s\\%S\\"), VARST(_T("%miranda_avatarcache%")), m_szModuleName);
FOLDERSGETDATA fgd = { sizeof(fgd) };
fgd.nMaxPathSize = SIZEOF(szPath);
diff --git a/protocols/IcqOscarJ/src/icq_proto.cpp b/protocols/IcqOscarJ/src/icq_proto.cpp index ff505dc1a4..25bb80d2c2 100644 --- a/protocols/IcqOscarJ/src/icq_proto.cpp +++ b/protocols/IcqOscarJ/src/icq_proto.cpp @@ -159,7 +159,7 @@ CIcqProto::CIcqProto(const char* aProtoName, const TCHAR* aUserName) : // Register netlib users
NETLIBUSER nlu = { 0 };
TCHAR szBuffer[MAX_PATH + 64];
- mir_sntprintf(szBuffer, SIZEOF(szBuffer), TranslateT("%s server connection"), m_tszUserName);
+ mir_sntprintf(szBuffer, TranslateT("%s server connection"), m_tszUserName);
nlu.cbSize = sizeof(nlu);
nlu.flags = NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR;
nlu.ptszDescriptiveName = szBuffer;
@@ -174,7 +174,7 @@ CIcqProto::CIcqProto(const char* aProtoName, const TCHAR* aUserName) : char szP2PModuleName[MAX_PATH];
mir_snprintf(szP2PModuleName, SIZEOF(szP2PModuleName), "%sP2P", m_szModuleName);
- mir_sntprintf(szBuffer, SIZEOF(szBuffer), TranslateT("%s client-to-client connections"), m_tszUserName);
+ mir_sntprintf(szBuffer, TranslateT("%s client-to-client connections"), m_tszUserName);
nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_TCHAR;
nlu.ptszDescriptiveName = szBuffer;
nlu.szSettingsModule = szP2PModuleName;
diff --git a/protocols/IcqOscarJ/src/userinfotab.cpp b/protocols/IcqOscarJ/src/userinfotab.cpp index 00dd66fac1..b286579faf 100644 --- a/protocols/IcqOscarJ/src/userinfotab.cpp +++ b/protocols/IcqOscarJ/src/userinfotab.cpp @@ -279,7 +279,7 @@ int CIcqProto::OnUserInfoInit(WPARAM wParam, LPARAM lParam) if (!lParam) {
TCHAR buf[200];
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("%s Details"), m_tszUserName);
+ mir_sntprintf(buf, TranslateT("%s Details"), m_tszUserName);
odp.ptszTitle = buf;
odp.position = -1899999999;
diff --git a/protocols/JabberG/src/jabber_adhoc.cpp b/protocols/JabberG/src/jabber_adhoc.cpp index 37160b7ad7..723b45a43a 100644 --- a/protocols/JabberG/src/jabber_adhoc.cpp +++ b/protocols/JabberG/src/jabber_adhoc.cpp @@ -154,7 +154,7 @@ int CJabberProto::AdHoc_OnJAHMCommandListResult(HWND hwndDlg, HXML iqNode, Jabbe code = xmlGetAttrValue(errorNode, _T("code"));
description = xmlGetText(errorNode);
}
- mir_sntprintf(buff, SIZEOF(buff), TranslateT("Error %s %s"), (code) ? code : _T(""), (description) ? description : _T(""));
+ mir_sntprintf(buff, TranslateT("Error %s %s"), (code) ? code : _T(""), (description) ? description : _T(""));
JabberFormSetInstruction(hwndDlg, buff);
}
else if (!mir_tstrcmp(type, _T("result"))) {
@@ -282,7 +282,7 @@ int CJabberProto::AdHoc_OnJAHMProcessResult(HWND hwndDlg, HXML workNode, JabberA code = xmlGetAttrValue(errorNode, _T("code"));
description = xmlGetText(errorNode);
}
- mir_sntprintf(buff, SIZEOF(buff), TranslateT("Error %s %s"), code ? code : _T(""), description ? description : _T(""));
+ mir_sntprintf(buff, TranslateT("Error %s %s"), code ? code : _T(""), description ? description : _T(""));
JabberFormSetInstruction(hwndDlg,buff);
}
JabberAdHoc_RefreshFrameScroll(hwndDlg, dat);
diff --git a/protocols/JabberG/src/jabber_byte.cpp b/protocols/JabberG/src/jabber_byte.cpp index ffbc79d77f..914a528824 100644 --- a/protocols/JabberG/src/jabber_byte.cpp +++ b/protocols/JabberG/src/jabber_byte.cpp @@ -363,7 +363,7 @@ int CJabberProto::ByteSendParse(HANDLE hConn, JABBER_BYTE_TRANSFER *jbt, char* b TCHAR *szInitiatorJid = JabberPrepareJid(jbt->srcJID);
TCHAR *szTargetJid = JabberPrepareJid(jbt->dstJID);
- mir_sntprintf(text, SIZEOF(text), _T("%s%s%s"), jbt->sid, szInitiatorJid, szTargetJid);
+ mir_sntprintf(text, _T("%s%s%s"), jbt->sid, szInitiatorJid, szTargetJid);
mir_free(szInitiatorJid);
mir_free(szTargetJid);
@@ -512,7 +512,7 @@ int CJabberProto::ByteSendProxyParse(HANDLE hConn, JABBER_BYTE_TRANSFER *jbt, ch TCHAR *szInitiatorJid = JabberPrepareJid(jbt->srcJID);
TCHAR *szTargetJid = JabberPrepareJid(jbt->dstJID);
- mir_sntprintf(text, SIZEOF(text), _T("%s%s%s"), jbt->sid, szInitiatorJid, szTargetJid);
+ mir_sntprintf(text, _T("%s%s%s"), jbt->sid, szInitiatorJid, szTargetJid);
mir_free(szInitiatorJid);
mir_free(szTargetJid);
@@ -707,7 +707,7 @@ int CJabberProto::ByteReceiveParse(HANDLE hConn, JABBER_BYTE_TRANSFER *jbt, char {
ptrT szInitiatorJid(JabberPrepareJid(jbt->srcJID));
ptrT szTargetJid(JabberPrepareJid(jbt->dstJID));
- mir_sntprintf(text, SIZEOF(text), _T("%s%s%s"), jbt->sid, szInitiatorJid, szTargetJid);
+ mir_sntprintf(text, _T("%s%s%s"), jbt->sid, szInitiatorJid, szTargetJid);
}
T2Utf szAuthString(text);
diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp index 4ac3010bea..6ecdb6548b 100644 --- a/protocols/JabberG/src/jabber_chat.cpp +++ b/protocols/JabberG/src/jabber_chat.cpp @@ -763,7 +763,7 @@ public: CLCINFOITEM cii = { 0 };
cii.cbSize = sizeof(cii);
cii.flags = CLCIIF_CHECKBOX;
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("%s (not on roster)"), jidData->jid);
+ mir_sntprintf(buf, TranslateT("%s (not on roster)"), jidData->jid);
cii.pszText = buf;
jidData->hItem = SendDlgItemMessage(m_hwnd, IDC_CLIST, CLM_ADDINFOITEM, 0, (LPARAM)&cii);
SendDlgItemMessage(m_hwnd, IDC_CLIST, CLM_SETCHECKMARK, jidData->hItem, 1);
@@ -858,7 +858,7 @@ static INT_PTR CALLBACK sttUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam SendDlgItemMessage(hwndDlg, IDC_ICO_STATUS, STM_SETICON, (WPARAM)LoadSkinnedProtoIcon(dat->ppro->m_szModuleName, dat->him->m_iStatus), 0);
TCHAR buf[256];
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("%s from\n%s"), dat->him->m_tszResourceName, dat->item->jid);
+ mir_sntprintf(buf, TranslateT("%s from\n%s"), dat->him->m_tszResourceName, dat->item->jid);
SetDlgItemText(hwndDlg, IDC_HEADERBAR, buf);
SetDlgItemText(hwndDlg, IDC_TXT_NICK, dat->him->m_tszResourceName);
@@ -1017,7 +1017,7 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* // do not use snprintf to avoid possible problems with % symbol
if (TCHAR *p = _tcsstr(szMessage, _T("%s"))) {
*p = 0;
- mir_sntprintf(buf, SIZEOF(buf), _T("%s%s%s"), szMessage, him->m_tszResourceName, p + 2);
+ mir_sntprintf(buf, _T("%s%s%s"), szMessage, him->m_tszResourceName, p + 2);
}
else mir_tstrncpy(buf, szMessage, SIZEOF(buf));
UnEscapeChatTags(buf);
@@ -1272,7 +1272,7 @@ static void sttLogListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* g if (ppro->EnterString(szBuffer, szTitle, ESF_COMBO, "gcNick_")) {
if (ppro->ListGetItemPtr(LIST_CHATROOM, gch->pDest->ptszID) != NULL) {
TCHAR text[1024];
- mir_sntprintf(text, SIZEOF(text), _T("%s/%s"), gch->pDest->ptszID, szBuffer);
+ mir_sntprintf(text, _T("%s/%s"), gch->pDest->ptszID, szBuffer);
ppro->SendPresenceTo(ppro->m_iStatus == ID_STATUS_INVISIBLE ? ID_STATUS_ONLINE : ppro->m_iStatus, text, NULL);
}
}
diff --git a/protocols/JabberG/src/jabber_groupchat.cpp b/protocols/JabberG/src/jabber_groupchat.cpp index 81b37b400e..14aadd27d8 100644 --- a/protocols/JabberG/src/jabber_groupchat.cpp +++ b/protocols/JabberG/src/jabber_groupchat.cpp @@ -246,7 +246,7 @@ void CJabberProto::GroupchatJoinRoom(const TCHAR *server, const TCHAR *room, con }
TCHAR text[JABBER_MAX_JID_LEN + 1];
- mir_sntprintf(text, SIZEOF(text), _T("%s@%s/%s"), room, server, nick);
+ mir_sntprintf(text, _T("%s@%s/%s"), room, server, nick);
JABBER_LIST_ITEM *item = ListAdd(LIST_CHATROOM, text);
item->bAutoJoin = autojoin;
@@ -1011,7 +1011,7 @@ void CJabberProto::GroupchatProcessPresence(HXML node) if (++item->iChatState == 1 && newNick != NULL && newNick[0] != 0) {
replaceStrT(item->nick, newNick);
TCHAR text[1024] = { 0 };
- mir_sntprintf(text, SIZEOF(text), _T("%s/%s"), item->jid, newNick);
+ mir_sntprintf(text, _T("%s/%s"), item->jid, newNick);
SendPresenceTo(m_iStatus, text, NULL);
}
else {
@@ -1164,7 +1164,7 @@ public: CSuper::OnInitDialog();
TCHAR buf[256];
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("Group chat invitation to\n%s"), m_info->roomJid);
+ mir_sntprintf(buf, TranslateT("Group chat invitation to\n%s"), m_info->roomJid);
SetDlgItemText(m_hwnd, IDC_HEADERBAR, buf);
SetDlgItemText(m_hwnd, IDC_FROM, m_info->from);
diff --git a/protocols/JabberG/src/jabber_iq_handlers.cpp b/protocols/JabberG/src/jabber_iq_handlers.cpp index 252da69c2f..d239ae052c 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, SIZEOF(buf), TEXT(" (build %d)"), osvi.dwBuildNumber);
+ mir_sntprintf(buf, TEXT(" (build %d)"), osvi.dwBuildNumber);
StringCchCat(pszOS, BUFSIZE, buf);
return TRUE;
}
diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp index eaa7edc593..38712cd0c1 100644 --- a/protocols/JabberG/src/jabber_iqid.cpp +++ b/protocols/JabberG/src/jabber_iqid.cpp @@ -239,7 +239,7 @@ void CJabberProto::OnIqResultGetAuth(HXML iqNode, CJabberIqInfo*) m_ThreadInfo->send("</stream:stream>");
TCHAR text[128];
- mir_sntprintf(text, SIZEOF(text), TranslateT("Authentication failed for %s."), m_ThreadInfo->conn.username);
+ mir_sntprintf(text, TranslateT("Authentication failed for %s."), m_ThreadInfo->conn.username);
MsgPopup(NULL, text, TranslateT("Jabber Authentication"));
JLoginFailed(LOGINERR_WRONGPASSWORD);
m_ThreadInfo = NULL; // To disallow auto reconnect
@@ -266,7 +266,7 @@ void CJabberProto::OnIqResultSetAuth(HXML iqNode, CJabberIqInfo*) TCHAR text[128];
m_ThreadInfo->send("</stream:stream>");
- mir_sntprintf(text, SIZEOF(text), TranslateT("Authentication failed for %s."), m_ThreadInfo->conn.username);
+ mir_sntprintf(text, TranslateT("Authentication failed for %s."), m_ThreadInfo->conn.username);
MsgPopup(NULL, text, TranslateT("Jabber Authentication"));
JLoginFailed(LOGINERR_WRONGPASSWORD);
m_ThreadInfo = NULL; // To disallow auto reconnect
@@ -815,9 +815,9 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*) hasHomeStreet = true;
if (hContact != NULL) {
if ((o=xmlGetChild(n, "EXTADR")) != NULL && xmlGetText(o) != NULL)
- mir_sntprintf(text, SIZEOF(text), _T("%s\r\n%s"), xmlGetText(m), xmlGetText(o));
+ mir_sntprintf(text, _T("%s\r\n%s"), xmlGetText(m), xmlGetText(o));
else if ((o=xmlGetChild(n, "EXTADD")) != NULL && xmlGetText(o) != NULL)
- mir_sntprintf(text, SIZEOF(text), _T("%s\r\n%s"), xmlGetText(m), xmlGetText(o));
+ mir_sntprintf(text, _T("%s\r\n%s"), xmlGetText(m), xmlGetText(o));
else
_tcsncpy_s(text, xmlGetText(m), _TRUNCATE);
text[SIZEOF(text)-1] = '\0';
@@ -858,9 +858,9 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*) hasWorkStreet = true;
if (hContact != NULL) {
if ((o=xmlGetChild(n, "EXTADR")) != NULL && xmlGetText(o) != NULL)
- mir_sntprintf(text, SIZEOF(text), _T("%s\r\n%s"), xmlGetText(m), xmlGetText(o));
+ mir_sntprintf(text, _T("%s\r\n%s"), xmlGetText(m), xmlGetText(o));
else if ((o=xmlGetChild(n, "EXTADD")) != NULL && xmlGetText(o) != NULL)
- mir_sntprintf(text, SIZEOF(text), _T("%s\r\n%s"), xmlGetText(m), xmlGetText(o));
+ mir_sntprintf(text, _T("%s\r\n%s"), xmlGetText(m), xmlGetText(o));
else
_tcsncpy_s(text, xmlGetText(m), _TRUNCATE);
text[SIZEOF(text)-1] = '\0';
diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp index 79335a9182..b5c762af08 100644 --- a/protocols/JabberG/src/jabber_menu.cpp +++ b/protocols/JabberG/src/jabber_menu.cpp @@ -748,11 +748,11 @@ void CJabberProto::MenuInit() mir_snprintf(srvFce, SIZEOF(srvFce), "%s/menuSetPriority/%d", m_szModuleName, steps[i]);
if (steps[i] > 0) {
- mir_sntprintf(szName, SIZEOF(szName), TranslateT("Increase priority by %d"), steps[i]);
+ mir_sntprintf(szName, TranslateT("Increase priority by %d"), steps[i]);
mi.icolibItem = GetIconHandle(IDI_ARROW_UP);
}
else {
- mir_sntprintf(szName, SIZEOF(szName), TranslateT("Decrease priority by %d"), -steps[i]);
+ mir_sntprintf(szName, TranslateT("Decrease priority by %d"), -steps[i]);
mi.icolibItem = GetIconHandle(IDI_ARROW_DOWN);
}
@@ -796,7 +796,7 @@ void CJabberProto::UpdatePriorityMenu(short priority) return;
TCHAR szName[128];
- mir_sntprintf(szName, SIZEOF(szName), TranslateT("Resource priority [%d]"), (int)priority);
+ mir_sntprintf(szName, TranslateT("Resource priority [%d]"), (int)priority);
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIF_TCHAR | CMIM_NAME | CMIF_KEEPUNTRANSLATED;
@@ -1036,7 +1036,7 @@ int CJabberProto::OnProcessSrmmIconClick(WPARAM hContact, LPARAM lParam) HMENU hMenu = CreatePopupMenu();
TCHAR buf[256];
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("Last active (%s)"),
+ mir_sntprintf(buf, TranslateT("Last active (%s)"),
LI->m_pLastSeenResource ? LI->m_pLastSeenResource->m_tszResourceName : TranslateT("No activity yet, use server's choice"));
AppendMenu(hMenu, MF_STRING, MENUITEM_LASTSEEN, buf);
@@ -1121,7 +1121,7 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleDirectPresence(WPARAM hContact, LPARAM if (item == NULL)
return 0;
- mir_sntprintf(text, SIZEOF(text), _T("%s/%s"), item->jid, item->nick);
+ mir_sntprintf(text, _T("%s/%s"), item->jid, item->nick);
jid = text;
}
else jid = tszJid;
diff --git a/protocols/JabberG/src/jabber_message_handlers.cpp b/protocols/JabberG/src/jabber_message_handlers.cpp index aabdec3b57..77e900c76e 100644 --- a/protocols/JabberG/src/jabber_message_handlers.cpp +++ b/protocols/JabberG/src/jabber_message_handlers.cpp @@ -44,9 +44,9 @@ BOOL CJabberProto::OnMessageError(HXML node, ThreadData*, CJabberMessageInfo* pI TCHAR buf[512];
HXML bodyNode = xmlGetChild(node, "body");
if (bodyNode)
- mir_sntprintf(buf, SIZEOF(buf), _T("%s:\n%s\n%s"), pInfo->GetFrom(), xmlGetText(bodyNode), szErrText);
+ mir_sntprintf(buf, _T("%s:\n%s\n%s"), pInfo->GetFrom(), xmlGetText(bodyNode), szErrText);
else
- mir_sntprintf(buf, SIZEOF(buf), _T("%s:\n%s"), pInfo->GetFrom(), szErrText);
+ mir_sntprintf(buf, _T("%s:\n%s"), pInfo->GetFrom(), szErrText);
MsgPopup(NULL, buf, TranslateT("Jabber Error"));
}
diff --git a/protocols/JabberG/src/jabber_notes.cpp b/protocols/JabberG/src/jabber_notes.cpp index e493e54c0d..a6800722c8 100644 --- a/protocols/JabberG/src/jabber_notes.cpp +++ b/protocols/JabberG/src/jabber_notes.cpp @@ -377,7 +377,7 @@ public: SelectObject(hdc, m_hfntNormal);
if (pNote->GetFrom()) {
TCHAR buf[256];
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("From: %s"), pNote->GetFrom());
+ mir_sntprintf(buf, TranslateT("From: %s"), pNote->GetFrom());
rc.top += DrawText(hdc, buf, -1, &rc, DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
}
rc.top += DrawText(hdc, pNote->GetText(), -1, &rc, DT_NOPREFIX | DT_WORDBREAK | DT_EXPANDTABS | DT_END_ELLIPSIS);
@@ -412,7 +412,7 @@ public: SelectObject(hdc, m_hfntNormal);
if (pNote->GetFrom()) {
TCHAR buf[256];
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("From: %s"), pNote->GetFrom());
+ mir_sntprintf(buf, TranslateT("From: %s"), pNote->GetFrom());
rcTmp = rc;
DrawText(hdc, buf, -1, &rcTmp, DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS | DT_CALCRECT);
lps->itemHeight += rcTmp.bottom;
@@ -729,7 +729,7 @@ void CJabberProto::ProcessOutgoingNote(CNoteItem *pNote, bool ok) }
TCHAR buf[1024];
- mir_sntprintf(buf, SIZEOF(buf), _T("Incoming note: %s\n\n%s\nTags: %s"),
+ mir_sntprintf(buf, _T("Incoming note: %s\n\n%s\nTags: %s"),
pNote->GetTitle(), pNote->GetText(), pNote->GetTagsStr());
JabberCapsBits jcb = GetResourceCapabilites(pNote->GetFrom(), TRUE);
diff --git a/protocols/JabberG/src/jabber_opt.cpp b/protocols/JabberG/src/jabber_opt.cpp index bdf8e06dc0..df53cb80f4 100644 --- a/protocols/JabberG/src/jabber_opt.cpp +++ b/protocols/JabberG/src/jabber_opt.cpp @@ -243,7 +243,7 @@ protected: void OnInitDialog()
{
TCHAR text[256];
- mir_sntprintf(text, SIZEOF(text), STR_FORMAT, TranslateT("Register"), m_regInfo->username, m_regInfo->server, m_regInfo->port);
+ mir_sntprintf(text, STR_FORMAT, TranslateT("Register"), m_regInfo->username, m_regInfo->server, m_regInfo->port);
SetDlgItemText(m_hwnd, IDC_REG_STATUS, text);
}
diff --git a/protocols/JabberG/src/jabber_password.cpp b/protocols/JabberG/src/jabber_password.cpp index 494b685230..e36ed79c55 100644 --- a/protocols/JabberG/src/jabber_password.cpp +++ b/protocols/JabberG/src/jabber_password.cpp @@ -50,7 +50,7 @@ static INT_PTR CALLBACK JabberChangePasswordDlgProc(HWND hwndDlg, UINT msg, WPAR TranslateDialogDefault(hwndDlg);
if (ppro->m_bJabberOnline && ppro->m_ThreadInfo != NULL) {
TCHAR text[1024];
- mir_sntprintf(text, SIZEOF(text), TranslateT("Set New Password for %s@%S"), ppro->m_ThreadInfo->conn.username, ppro->m_ThreadInfo->conn.server);
+ mir_sntprintf(text, TranslateT("Set New Password for %s@%S"), ppro->m_ThreadInfo->conn.username, ppro->m_ThreadInfo->conn.server);
SetWindowText(hwndDlg, text);
}
return TRUE;
diff --git a/protocols/JabberG/src/jabber_privacy.cpp b/protocols/JabberG/src/jabber_privacy.cpp index 2169b02f1d..2b7309779f 100644 --- a/protocols/JabberG/src/jabber_privacy.cpp +++ b/protocols/JabberG/src/jabber_privacy.cpp @@ -58,9 +58,9 @@ void CJabberProto::OnIqResultPrivacyListModify(HXML, CJabberIqInfo *pInfo) if (!pParam->m_dwCount) {
TCHAR szText[ 512 ];
if (!pParam->m_bAllOk)
- mir_sntprintf(szText, SIZEOF(szText), TranslateT("Error occurred while applying changes"));
+ mir_sntprintf(szText, TranslateT("Error occurred while applying changes"));
else
- mir_sntprintf(szText, SIZEOF(szText), TranslateT("Privacy lists successfully saved"));
+ mir_sntprintf(szText, TranslateT("Privacy lists successfully saved"));
if (m_pDlgPrivacyLists)
m_pDlgPrivacyLists->SetStatusText(szText);
// FIXME: enable apply button
@@ -226,14 +226,14 @@ void CJabberProto::OnIqResultPrivacyListDefault(HXML iqNode, CJabberIqInfo *pInf CPrivacyList *pList = (CPrivacyList *)pInfo->GetUserData();
if (pList) {
m_privacyListManager.SetDefaultListName(pList->GetListName());
- mir_sntprintf(szText, SIZEOF(szText), TranslateT("Privacy list %s set as default"), pList->GetListName());
+ mir_sntprintf(szText, TranslateT("Privacy list %s set as default"), pList->GetListName());
}
else {
m_privacyListManager.SetDefaultListName(NULL);
- mir_sntprintf(szText, SIZEOF(szText), TranslateT("Default privacy list successfully declined"));
+ mir_sntprintf(szText, TranslateT("Default privacy list successfully declined"));
}
}
- else mir_sntprintf(szText, SIZEOF(szText), TranslateT("Error occurred while setting default list"));
+ else mir_sntprintf(szText, TranslateT("Error occurred while setting default list"));
}
if (m_pDlgPrivacyLists) {
diff --git a/protocols/JabberG/src/jabber_search.cpp b/protocols/JabberG/src/jabber_search.cpp index 06cd7a8fa2..af1ebda659 100644 --- a/protocols/JabberG/src/jabber_search.cpp +++ b/protocols/JabberG/src/jabber_search.cpp @@ -192,7 +192,7 @@ void CJabberProto::OnIqResultGetSearchFields(HXML iqNode, CJabberIqInfo*) code = xmlGetAttrValue(errorNode, _T("code")); description = xmlGetText(errorNode); } - mir_sntprintf(buff, SIZEOF(buff), TranslateT("Error %s %s\r\nPlease select other server"), code ? code : _T(""), description ? description : _T("")); + mir_sntprintf(buff, TranslateT("Error %s %s\r\nPlease select other server"), code ? code : _T(""), description ? description : _T("")); SetDlgItemText(searchHandleDlg, IDC_INSTRUCTIONS, buff); } else SetDlgItemText(searchHandleDlg, IDC_INSTRUCTIONS, TranslateT("Error: unknown reply received\r\nPlease select other server")); @@ -271,7 +271,7 @@ void CJabberProto::SearchReturnResults(HANDLE id, void * pvUsersInfo, U_TCHAR_M if (nick) { if (mir_tstrcmpi(nick, Results.psr.id.t)) - mir_sntprintf(buff, SIZEOF(buff), _T("%s (%s)"), nick, Results.psr.id.t); + mir_sntprintf(buff, _T("%s (%s)"), nick, Results.psr.id.t); else _tcsncpy_s(buff, nick, _TRUNCATE); @@ -389,7 +389,7 @@ void CJabberProto::OnIqResultAdvancedSearch(HXML iqNode, CJabberIqInfo*) description = xmlGetText(errorNode); } - mir_sntprintf(buff, SIZEOF(buff), TranslateT("Error %s %s\r\nTry to specify more detailed"), code ? code : _T(""), description ? description : _T("")); + mir_sntprintf(buff, TranslateT("Error %s %s\r\nTry to specify more detailed"), code ? code : _T(""), description ? description : _T("")); ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)id, 0); if (searchHandleDlg) SetDlgItemText(searchHandleDlg, IDC_INSTRUCTIONS, buff); diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index c7a1354fa1..cd3e8d0d18 100644 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -77,7 +77,7 @@ static INT_PTR CALLBACK JabberPasswordDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
TCHAR text[512];
- mir_sntprintf(text, SIZEOF(text), TranslateT("Enter password for %s"), param->ptszJid);
+ mir_sntprintf(text, TranslateT("Enter password for %s"), param->ptszJid);
SetDlgItemText(hwndDlg, IDC_JID, text);
int bSavePassword = param->pro->getByte("SaveSessionPassword", 0);
@@ -651,7 +651,7 @@ void CJabberProto::PerformAuthentication(ThreadData *info) }
TCHAR text[1024];
- mir_sntprintf(text, SIZEOF(text), TranslateT("Authentication failed for %s@%S."), info->conn.username, info->conn.server);
+ mir_sntprintf(text, TranslateT("Authentication failed for %s@%S."), info->conn.username, info->conn.server);
MsgPopup(NULL, text, TranslateT("Jabber Authentication"));
JLoginFailed(LOGINERR_WRONGPASSWORD);
info->send("</stream:stream>");
diff --git a/protocols/JabberG/src/jabber_userinfo.cpp b/protocols/JabberG/src/jabber_userinfo.cpp index d3958b3436..7ac15547a1 100644 --- a/protocols/JabberG/src/jabber_userinfo.cpp +++ b/protocols/JabberG/src/jabber_userinfo.cpp @@ -174,7 +174,7 @@ static HTREEITEM sttFillInfoLine(HWND hwndTree, HTREEITEM htiRoot, HICON hIcon, TCHAR buf[256]; if (title) - mir_sntprintf(buf, SIZEOF(buf), _T("%s: %s"), title, value); + mir_sntprintf(buf, _T("%s: %s"), title, value); else mir_tstrncpy(buf, value, SIZEOF(buf)); @@ -227,7 +227,7 @@ static void sttFillResourceInfo(CJabberProto *ppro, HWND hwndTree, HTREEITEM hti HICON hIcon = NULL; if ( ServiceExists(MS_FP_GETCLIENTICONT)) { if (r->m_tszSoftware != NULL) { - mir_sntprintf(buf, SIZEOF(buf), _T("%s %s"), r->m_tszSoftware, r->m_tszSoftwareVersion); + mir_sntprintf(buf, _T("%s %s"), r->m_tszSoftware, r->m_tszSoftwareVersion); hIcon = Finger_GetClientIcon(buf, 0); } } @@ -269,7 +269,7 @@ static void sttFillResourceInfo(CJabberProto *ppro, HWND hwndTree, HTREEITEM hti sttFillInfoLine(hwndTree, htiResource, NULL, TranslateT("Idle since"), buf, sttInfoLineId(resource, INFOLINE_IDLE)); // caps - mir_sntprintf(buf, SIZEOF(buf), _T("%s/%s"), item->jid, r->m_tszResourceName); + mir_sntprintf(buf, _T("%s/%s"), item->jid, r->m_tszResourceName); JabberCapsBits jcb = ppro->GetResourceCapabilites(buf, TRUE); if (!(jcb & JABBER_RESOURCE_CAPS_ERROR)) { @@ -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, SIZEOF(szText), _T("%s (%s)"), TranslateTS(szAdvStatusTitle), szAdvStatusText); + mir_sntprintf(szText, _T("%s (%s)"), TranslateTS(szAdvStatusTitle), szAdvStatusText); else _tcsncpy_s(szText, TranslateTS(szAdvStatusTitle), _TRUNCATE); sttFillInfoLine(hwndTree, htiRoot, Skin_GetIcon(szAdvStatusIcon), szTitle, szText, dwInfoLine); @@ -498,7 +498,7 @@ static INT_PTR CALLBACK JabberUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa case WM_CONTEXTMENU: if (GetWindowLongPtr((HWND)wParam, GWL_ID) == IDC_TV_INFO) { HWND hwndTree = GetDlgItem(hwndDlg, IDC_TV_INFO); - POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
+ POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) }; HTREEITEM hItem = 0; if ((pt.x == -1) && (pt.y == -1)) { @@ -678,19 +678,19 @@ static INT_PTR CALLBACK JabberUserPhotoDlgProc(HWND hwndDlg, UINT msg, WPARAM wP switch (ProtoGetAvatarFileFormat(item->photoFileName)) { case PA_FORMAT_BMP: - mir_sntprintf(szFilter, SIZEOF(szFilter), _T("BMP %s (*.bmp)%c*.BMP"), TranslateT("format"), 0); + mir_sntprintf(szFilter, _T("BMP %s (*.bmp)%c*.BMP"), TranslateT("format"), 0); break; case PA_FORMAT_GIF: - mir_sntprintf(szFilter, SIZEOF(szFilter), _T("GIF %s (*.gif)%c*.GIF"), TranslateT("format"), 0); + mir_sntprintf(szFilter, _T("GIF %s (*.gif)%c*.GIF"), TranslateT("format"), 0); break; case PA_FORMAT_JPEG: - mir_sntprintf(szFilter, SIZEOF(szFilter), _T("JPEG %s (*.jpg;*.jpeg)%c*.JPG;*.JPEG"), TranslateT("format"), 0); + mir_sntprintf(szFilter, _T("JPEG %s (*.jpg;*.jpeg)%c*.JPG;*.JPEG"), TranslateT("format"), 0); break; default: - mir_sntprintf(szFilter, SIZEOF(szFilter), _T("%s (*.*)%c*.*"), TranslateT("Unknown format"), 0); + mir_sntprintf(szFilter, _T("%s (*.*)%c*.*"), TranslateT("Unknown format"), 0); } TCHAR szFileName[MAX_PATH]; szFileName[0] = '\0'; diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp index 662240451c..ded31eb3ef 100644 --- a/protocols/JabberG/src/jabber_util.cpp +++ b/protocols/JabberG/src/jabber_util.cpp @@ -528,7 +528,7 @@ void CJabberProto::SendPresence(int status, bool bSendToAll) JABBER_LIST_ITEM *item = ListGetItemPtrFromIndex(i);
if (item != NULL) {
TCHAR text[1024];
- mir_sntprintf(text, SIZEOF(text), _T("%s/%s"), item->jid, item->nick);
+ mir_sntprintf(text, _T("%s/%s"), item->jid, item->nick);
SendPresenceTo(status == ID_STATUS_INVISIBLE ? ID_STATUS_ONLINE : status, text, NULL);
}
}
@@ -551,7 +551,7 @@ int __stdcall JabberGetPacketID(HXML n) TCHAR* __stdcall JabberId2string(int id)
{
TCHAR text[100];
- mir_sntprintf(text, SIZEOF(text), _T(JABBER_IQID) _T("%d"), id);
+ mir_sntprintf(text, _T(JABBER_IQID) _T("%d"), id);
return mir_tstrdup(text);
}
diff --git a/protocols/JabberG/src/jabber_xml.cpp b/protocols/JabberG/src/jabber_xml.cpp index 616ee41f0f..0d75e02496 100644 --- a/protocols/JabberG/src/jabber_xml.cpp +++ b/protocols/JabberG/src/jabber_xml.cpp @@ -154,7 +154,7 @@ void __fastcall xmlAddAttr(HXML hXml, LPCTSTR pszName, unsigned __int64 value) void __fastcall xmlAddAttrID(HXML hXml, int id)
{
TCHAR text[100];
- mir_sntprintf(text, SIZEOF(text), _T(JABBER_IQID) _T("%d"), id);
+ mir_sntprintf(text, _T(JABBER_IQID) _T("%d"), id);
xmlAddAttr(hXml, _T("id"), text);
}
diff --git a/protocols/JabberG/src/jabber_xstatus.cpp b/protocols/JabberG/src/jabber_xstatus.cpp index 473f0b5292..a6351238ba 100644 --- a/protocols/JabberG/src/jabber_xstatus.cpp +++ b/protocols/JabberG/src/jabber_xstatus.cpp @@ -68,7 +68,7 @@ void CJabberDlgPepBase::OnInitDialog() SetTimer(m_hwnd, 1, 1000, NULL);
TCHAR buf[128];
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("OK (%d)"), m_time);
+ mir_sntprintf(buf, TranslateT("OK (%d)"), m_time);
m_btnOk.SetText(buf);
}
@@ -89,7 +89,7 @@ INT_PTR CJabberDlgPepBase::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) case WM_TIMER:
if (wParam == 1) {
TCHAR buf[128];
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("OK (%d)"), --m_time);
+ mir_sntprintf(buf, TranslateT("OK (%d)"), --m_time);
m_btnOk.SetText(buf);
if (m_time < 0) {
@@ -341,7 +341,7 @@ BOOL CJabberDlgPepSimple::OnWmDrawItem(UINT, WPARAM, LPARAM lParam) if (mode->m_subitem) {
for (int i = lpdis->itemData; i >= 0; --i)
if (!m_modes[i].m_subitem) {
- mir_sntprintf(text, SIZEOF(text), _T("%s [%s]"), m_modes[i].m_title, mode->m_title);
+ mir_sntprintf(text, _T("%s [%s]"), m_modes[i].m_title, mode->m_title);
break;
}
}
@@ -352,7 +352,7 @@ BOOL CJabberDlgPepSimple::OnWmDrawItem(UINT, WPARAM, LPARAM lParam) }
else {
TCHAR text[128];
- mir_sntprintf(text, SIZEOF(text), _T("...%s"), mode->m_title);
+ mir_sntprintf(text, _T("...%s"), mode->m_title);
DrawIconEx(lpdis->hDC, lpdis->rcItem.left + 23, (lpdis->rcItem.top + lpdis->rcItem.bottom - 16) / 2, mode->m_hIcon, 16, 16, 0, NULL, DI_NORMAL);
TextOut(lpdis->hDC, lpdis->rcItem.left + 44, (lpdis->rcItem.top + lpdis->rcItem.bottom - tm.tmHeight) / 2, text, (int)mir_tstrlen(text));
}
diff --git a/protocols/MRA/src/MraAvatars.cpp b/protocols/MRA/src/MraAvatars.cpp index 28f74a6c45..fc53c18d8e 100644 --- a/protocols/MRA/src/MraAvatars.cpp +++ b/protocols/MRA/src/MraAvatars.cpp @@ -56,7 +56,7 @@ DWORD CMraProto::MraAvatarsQueueInitialize(HANDLE *phAvatarsQueueHandle) MRA_AVATARS_QUEUE *pmraaqAvatarsQueue = new MRA_AVATARS_QUEUE();
TCHAR szBuffer[MAX_PATH];
- mir_sntprintf(szBuffer, SIZEOF(szBuffer), _T("%s %s"), m_tszUserName, TranslateT("Avatars' plugin connections"));
+ mir_sntprintf(szBuffer, _T("%s %s"), m_tszUserName, TranslateT("Avatars' plugin connections"));
NETLIBUSER nlu = { sizeof(nlu) };
nlu.flags = NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR;
diff --git a/protocols/MSN/src/msn_chat.cpp b/protocols/MSN/src/msn_chat.cpp index 396cb4aae2..6920312d4f 100644 --- a/protocols/MSN/src/msn_chat.cpp +++ b/protocols/MSN/src/msn_chat.cpp @@ -55,7 +55,7 @@ int CMsnProto::MSN_ChatInit(GCThreadData *info, const char *pszID, const char *p TCHAR szName[512];
InterlockedIncrement(&m_chatID);
if (*pszTopic) _tcsncpy(szName, _A2T(pszTopic), SIZEOF(szName));
- else mir_sntprintf(szName, SIZEOF(szName), _T("%s %s%d"),
+ else mir_sntprintf(szName, _T("%s %s%d"),
m_tszUserName, TranslateT("Chat #"), m_chatID);
GCSESSION gcw = { sizeof(gcw) };
diff --git a/protocols/MSN/src/msn_commands.cpp b/protocols/MSN/src/msn_commands.cpp index 7d0eeac2a5..c65359a54a 100644 --- a/protocols/MSN/src/msn_commands.cpp +++ b/protocols/MSN/src/msn_commands.cpp @@ -1501,7 +1501,7 @@ void CMsnProto::MSN_InviteMessage(ThreadData* info, char* msgBody, char* email, // netmeeting receive 1
if (Appname != NULL && !_stricmp(Appname, "NetMeeting")) {
TCHAR text[512], *tszEmail = mir_a2t(email);
- mir_sntprintf(text, SIZEOF(text), TranslateT("Accept NetMeeting request from %s?"), tszEmail);
+ mir_sntprintf(text, TranslateT("Accept NetMeeting request from %s?"), tszEmail);
mir_free(tszEmail);
if (MessageBox(NULL, text, TranslateT("MSN Protocol"), MB_YESNO | MB_ICONQUESTION) == IDYES) {
diff --git a/protocols/MSN/src/msn_lists.cpp b/protocols/MSN/src/msn_lists.cpp index b58e6c36a8..22c1f57fde 100644 --- a/protocols/MSN/src/msn_lists.cpp +++ b/protocols/MSN/src/msn_lists.cpp @@ -239,7 +239,7 @@ void CMsnProto::MSN_CleanupLists(void) if (count) {
TCHAR text[256];
TCHAR *sze = mir_a2t(p.email);
- mir_sntprintf(text, SIZEOF(text), TranslateT("Contact %s has been removed from the server.\nWould you like to keep it as \"Local Only\" contact to preserve history?"), sze);
+ mir_sntprintf(text, TranslateT("Contact %s has been removed from the server.\nWould you like to keep it as \"Local Only\" contact to preserve history?"), sze);
mir_free(sze);
TCHAR title[128];
diff --git a/protocols/MSN/src/msn_proto.cpp b/protocols/MSN/src/msn_proto.cpp index 195f7a4303..bde4541e40 100644 --- a/protocols/MSN/src/msn_proto.cpp +++ b/protocols/MSN/src/msn_proto.cpp @@ -130,7 +130,7 @@ CMsnProto::CMsnProto(const char* aProtoName, const TCHAR* aUserName) : nlu1.ptszDescriptiveName = szBuffer;
mir_snprintf(szDbsettings, SIZEOF(szDbsettings), "%s_HTTPS", m_szModuleName);
- mir_sntprintf(szBuffer, SIZEOF(szBuffer), TranslateT("%s plugin HTTPS connections"), m_tszUserName);
+ mir_sntprintf(szBuffer, TranslateT("%s plugin HTTPS connections"), m_tszUserName);
hNetlibUserHttps = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu1);
NETLIBUSER nlu = { 0 };
@@ -144,7 +144,7 @@ CMsnProto::CMsnProto(const char* aProtoName, const TCHAR* aUserName) : nlu.pfnHttpGatewayWrapSend = msn_httpGatewayWrapSend;
nlu.pfnHttpGatewayUnwrapRecv = msn_httpGatewayUnwrapRecv;
- mir_sntprintf(szBuffer, SIZEOF(szBuffer), TranslateT("%s plugin connections"), m_tszUserName);
+ mir_sntprintf(szBuffer, TranslateT("%s plugin connections"), m_tszUserName);
m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
m_DisplayNameCache = NULL;
diff --git a/protocols/MinecraftDynmap/src/proto.cpp b/protocols/MinecraftDynmap/src/proto.cpp index 7400223e38..5a354daa00 100644 --- a/protocols/MinecraftDynmap/src/proto.cpp +++ b/protocols/MinecraftDynmap/src/proto.cpp @@ -45,12 +45,12 @@ MinecraftDynmapProto::MinecraftDynmapProto(const char* proto_name, const TCHAR* NETLIBUSER nlu = {sizeof(nlu)}; nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR; nlu.szSettingsModule = m_szModuleName; - mir_sntprintf(descr, SIZEOF(descr), TranslateT("%s server connection"), m_tszUserName); + mir_sntprintf(descr, TranslateT("%s server connection"), m_tszUserName); nlu.ptszDescriptiveName = descr; m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu); if (m_hNetlibUser == NULL) { TCHAR error[200]; - mir_sntprintf(error, SIZEOF(error), TranslateT("Unable to initialize Netlib for %s."), m_tszUserName); + mir_sntprintf(error, TranslateT("Unable to initialize Netlib for %s."), m_tszUserName); MessageBox(NULL, error, _T("Miranda NG"), MB_OK | MB_ICONERROR); } diff --git a/protocols/Omegle/src/proto.cpp b/protocols/Omegle/src/proto.cpp index fa5a0a7d04..7419a9dcb8 100644 --- a/protocols/Omegle/src/proto.cpp +++ b/protocols/Omegle/src/proto.cpp @@ -52,7 +52,7 @@ OmegleProto::OmegleProto(const char* proto_name, const TCHAR* username) : m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER,0,(LPARAM)&nlu);
if (m_hNetlibUser == NULL) {
TCHAR error[200];
- mir_sntprintf(error, SIZEOF(error), TranslateT("Unable to initialize Netlib for %s."), m_tszUserName);
+ mir_sntprintf(error, TranslateT("Unable to initialize Netlib for %s."), m_tszUserName);
MessageBox(NULL, error, _T("Miranda NG"), MB_OK | MB_ICONERROR);
}
diff --git a/protocols/Sametime/src/sametime_session.cpp b/protocols/Sametime/src/sametime_session.cpp index 828e8808db..d8e146447e 100644 --- a/protocols/Sametime/src/sametime_session.cpp +++ b/protocols/Sametime/src/sametime_session.cpp @@ -213,7 +213,7 @@ void __cdecl SessionSetUserStatus(struct mwSession* session) default:
TCHAR buff[512];
- mir_sntprintf(buff, SIZEOF(buff), TranslateT("Unknown user status: %d"), us.status);
+ mir_sntprintf(buff, TranslateT("Unknown user status: %d"), us.status);
proto->showPopup(buff, SAMETIME_POPUP_ERROR);
proto->debugLog(buff);
diff --git a/protocols/Sametime/src/utils.cpp b/protocols/Sametime/src/utils.cpp index eeccb5a661..1d464b16a1 100644 --- a/protocols/Sametime/src/utils.cpp +++ b/protocols/Sametime/src/utils.cpp @@ -144,13 +144,13 @@ void CSametimeProto::showPopup(guint32 code) SametimePopupEnum flag = (rcDesc->type == mwReturnCodeError ? SAMETIME_POPUP_ERROR : SAMETIME_POPUP_INFO);
TCHAR buff[512];
- mir_sntprintf(buff, SIZEOF(buff), TranslateT("%s\n\nSametime error %S\n%s"), TranslateTS(_A2T(rcDesc->name)), rcDesc->codeString, TranslateTS(_A2T(rcDesc->description)));
+ mir_sntprintf(buff, TranslateT("%s\n\nSametime error %S\n%s"), TranslateTS(_A2T(rcDesc->name)), rcDesc->codeString, TranslateTS(_A2T(rcDesc->description)));
showPopup(buff, flag);
debugLog(buff);
- g_free(rcDesc->codeString); - g_free(rcDesc->name); + g_free(rcDesc->codeString);
+ g_free(rcDesc->name);
g_free(rcDesc->description);
g_free(rcDesc);
}
diff --git a/protocols/Twitter/src/proto.cpp b/protocols/Twitter/src/proto.cpp index b2992b22f4..752a3f78a2 100644 --- a/protocols/Twitter/src/proto.cpp +++ b/protocols/Twitter/src/proto.cpp @@ -321,12 +321,12 @@ int TwitterProto::OnModulesLoaded(WPARAM, LPARAM) nlu.szSettingsModule = m_szModuleName;
// Create standard network connection
- mir_sntprintf(descr, SIZEOF(descr), TranslateT("%s server connection"), m_tszUserName);
+ mir_sntprintf(descr, TranslateT("%s server connection"), m_tszUserName);
nlu.ptszDescriptiveName = descr;
m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
if (m_hNetlibUser == NULL) {
TCHAR error[200];
- mir_sntprintf(error, SIZEOF(error), TranslateT("Unable to initialize Netlib for %s."), m_tszUserName);
+ mir_sntprintf(error, TranslateT("Unable to initialize Netlib for %s."), m_tszUserName);
MessageBox(NULL, error, _T("Miranda NG"), MB_OK | MB_ICONERROR);
}
@@ -334,12 +334,12 @@ int TwitterProto::OnModulesLoaded(WPARAM, LPARAM) char module[512];
mir_snprintf(module, SIZEOF(module), "%sAv", m_szModuleName);
nlu.szSettingsModule = module;
- mir_sntprintf(descr, SIZEOF(descr), TranslateT("%s avatar connection"), m_tszUserName);
+ mir_sntprintf(descr, TranslateT("%s avatar connection"), m_tszUserName);
nlu.ptszDescriptiveName = descr;
hAvatarNetlib_ = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
if (hAvatarNetlib_ == NULL) {
TCHAR error[200];
- mir_sntprintf(error, SIZEOF(error), TranslateT("Unable to initialize Netlib for %s."), TranslateT("Twitter (avatars)"));
+ mir_sntprintf(error, TranslateT("Unable to initialize Netlib for %s."), TranslateT("Twitter (avatars)"));
MessageBox(NULL, error, _T("Miranda NG"), MB_OK | MB_ICONERROR);
}
diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp index 28f0e88289..a09c0b35e0 100644 --- a/protocols/VKontakte/src/vk_proto.cpp +++ b/protocols/VKontakte/src/vk_proto.cpp @@ -52,7 +52,7 @@ CVkProto::CVkProto(const char *szModuleName, const TCHAR *ptszUserName) : HookProtoEvent(ME_OPT_INITIALISE, &CVkProto::OnOptionsInit);
TCHAR descr[512];
- mir_sntprintf(descr, SIZEOF(descr), TranslateT("%s server connection"), m_tszUserName);
+ mir_sntprintf(descr, TranslateT("%s server connection"), m_tszUserName);
NETLIBUSER nlu = {sizeof(nlu)};
nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR;
diff --git a/protocols/WhatsApp/src/proto.cpp b/protocols/WhatsApp/src/proto.cpp index 9b89beeaa1..780bd12159 100644 --- a/protocols/WhatsApp/src/proto.cpp +++ b/protocols/WhatsApp/src/proto.cpp @@ -34,7 +34,7 @@ WhatsAppProto::WhatsAppProto(const char* proto_name, const TCHAR* username) : // Create standard network connection
TCHAR descr[512];
- mir_sntprintf(descr, SIZEOF(descr), TranslateT("%s server connection"), m_tszUserName);
+ mir_sntprintf(descr, TranslateT("%s server connection"), m_tszUserName);
NETLIBUSER nlu = { sizeof(nlu) };
nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR;
@@ -43,7 +43,7 @@ WhatsAppProto::WhatsAppProto(const char* proto_name, const TCHAR* username) : m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
if (m_hNetlibUser == NULL) {
TCHAR error[200];
- mir_sntprintf(error, SIZEOF(error), TranslateT("Unable to initialize Netlib for %s."), m_tszUserName);
+ mir_sntprintf(error, TranslateT("Unable to initialize Netlib for %s."), m_tszUserName);
MessageBox(NULL, error, _T("Miranda NG"), MB_OK | MB_ICONERROR);
}
diff --git a/protocols/Yahoo/src/yahoo.cpp b/protocols/Yahoo/src/yahoo.cpp index 58c9089d4d..c0e8dee551 100644 --- a/protocols/Yahoo/src/yahoo.cpp +++ b/protocols/Yahoo/src/yahoo.cpp @@ -670,7 +670,7 @@ void CYahooProto::ext_rejected(const char *who, const char *msg) ptrT tszMsg( mir_utf8decodeT(msg));
TCHAR buff[1024];
- mir_sntprintf(buff, SIZEOF(buff), TranslateT("%s has rejected your request and sent the following message:"), (TCHAR*)tszWho);
+ mir_sntprintf(buff, TranslateT("%s has rejected your request and sent the following message:"), (TCHAR*)tszWho);
MessageBox(NULL, tszMsg, buff, MB_OK | MB_ICONINFORMATION );
}
@@ -1056,33 +1056,33 @@ void CYahooProto::ext_login_response(int succ, const char *url) }
if (succ == YAHOO_LOGIN_UNAME) {
- mir_sntprintf(buff, SIZEOF(buff), TranslateT("Could not log into Yahoo service - username not recognized. Please verify that your username is correctly typed."));
+ mir_sntprintf(buff, TranslateT("Could not log into Yahoo service - username not recognized. Please verify that your username is correctly typed."));
ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_BADUSERID);
}
else if (succ == YAHOO_LOGIN_PASSWD) {
- mir_sntprintf(buff, SIZEOF(buff), TranslateT("Could not log into Yahoo service - password incorrect. Please verify that your username and password are correctly typed."));
+ mir_sntprintf(buff, TranslateT("Could not log into Yahoo service - password incorrect. Please verify that your username and password are correctly typed."));
ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_WRONGPASSWORD);
}
else if (succ == YAHOO_LOGIN_LOCK) {
- mir_sntprintf(buff, SIZEOF(buff), TranslateT("Could not log into Yahoo service. Your account has been locked.\nVisit %s to reactivate it."), _A2T(url));
+ mir_sntprintf(buff, TranslateT("Could not log into Yahoo service. Your account has been locked.\nVisit %s to reactivate it."), _A2T(url));
}
else if (succ == YAHOO_LOGIN_DUPL) {
- mir_sntprintf(buff, SIZEOF(buff), TranslateT("You have been logged out of the Yahoo service, possibly due to a duplicate login."));
+ mir_sntprintf(buff, TranslateT("You have been logged out of the Yahoo service, possibly due to a duplicate login."));
ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_OTHERLOCATION);
}
else if (succ == YAHOO_LOGIN_LOGOFF) {
- //mir_sntprintf(buff, SIZEOF(buff), TranslateT("You have been logged out of the Yahoo service."));
+ //mir_sntprintf(buff, TranslateT("You have been logged out of the Yahoo service."));
//ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_OTHERLOCATION);
return; // we logged out.. so just sign-off..
}
else if (succ == -1) {
/// Can't Connect or got disconnected.
if (m_iStatus == ID_STATUS_CONNECTING)
- mir_sntprintf(buff, SIZEOF(buff), TranslateT("Could not connect to the Yahoo service. Check your server/port and proxy settings."));
+ mir_sntprintf(buff, TranslateT("Could not connect to the Yahoo service. Check your server/port and proxy settings."));
else
return;
}
- else mir_sntprintf(buff, SIZEOF(buff), TranslateT("Could not log in, unknown reason: %d."), succ);
+ else mir_sntprintf(buff, TranslateT("Could not log in, unknown reason: %d."), succ);
delSetting(YAHOO_PWTOKEN);
@@ -1108,28 +1108,28 @@ void CYahooProto::ext_error(const char *err, int fatal, int num) switch(num) {
case E_UNKNOWN:
- mir_sntprintf(buff, SIZEOF(buff), TranslateT("Unknown error %s"), (TCHAR*)tszErr);
+ mir_sntprintf(buff, TranslateT("Unknown error %s"), (TCHAR*)tszErr);
break;
case E_CUSTOM:
- mir_sntprintf(buff, SIZEOF(buff), TranslateT("Custom error %s"), (TCHAR*)tszErr);
+ mir_sntprintf(buff, TranslateT("Custom error %s"), (TCHAR*)tszErr);
break;
case E_CONFNOTAVAIL:
- mir_sntprintf(buff, SIZEOF(buff), TranslateT("%s is not available for the conference"), (TCHAR*)tszErr);
+ mir_sntprintf(buff, TranslateT("%s is not available for the conference"), (TCHAR*)tszErr);
break;
case E_IGNOREDUP:
- mir_sntprintf(buff, SIZEOF(buff), TranslateT("%s is already ignored"), (TCHAR*)tszErr);
+ mir_sntprintf(buff, TranslateT("%s is already ignored"), (TCHAR*)tszErr);
break;
case E_IGNORENONE:
- mir_sntprintf(buff, SIZEOF(buff), TranslateT("%s is not in the ignore list"), (TCHAR*)tszErr);
+ mir_sntprintf(buff, TranslateT("%s is not in the ignore list"), (TCHAR*)tszErr);
break;
case E_IGNORECONF:
- mir_sntprintf(buff, SIZEOF(buff), TranslateT("%s is in buddy list - cannot ignore"), (TCHAR*)tszErr);
+ mir_sntprintf(buff, TranslateT("%s is in buddy list - cannot ignore"), (TCHAR*)tszErr);
break;
case E_SYSTEM:
- mir_sntprintf(buff, SIZEOF(buff), TranslateT("System Error: %s"), (TCHAR*)tszErr);
+ mir_sntprintf(buff, TranslateT("System Error: %s"), (TCHAR*)tszErr);
break;
case E_CONNECTION:
- mir_sntprintf(buff, SIZEOF(buff), TranslateT("Server Connection Error: %s"), (TCHAR*)tszErr);
+ mir_sntprintf(buff, TranslateT("Server Connection Error: %s"), (TCHAR*)tszErr);
debugLogA("Error: %S", buff);
return;
}
|