From b7c74cd5b22618d544a3f4ae124985d4837e3a22 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 4 Jun 2015 22:12:13 +0000 Subject: new mir_snprintf templates without SIZEOF git-svn-id: http://svn.miranda-ng.org/main/trunk@14002 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/FacebookRM/src/events.cpp | 12 +++---- protocols/FacebookRM/src/proto.cpp | 24 ++++++------- protocols/GTalkExt/src/avatar.cpp | 2 +- protocols/GTalkExt/src/handlers.cpp | 4 +-- protocols/GTalkExt/src/inbox.cpp | 4 +-- protocols/GTalkExt/src/notifications.cpp | 6 ++-- protocols/GTalkExt/src/options.cpp | 4 +-- protocols/Gadu-Gadu/src/avatar.cpp | 2 +- protocols/Gadu-Gadu/src/oauth.cpp | 2 +- protocols/IRCG/src/clist.cpp | 2 +- protocols/IRCG/src/irclib.cpp | 6 ++-- protocols/IcqOscarJ/src/editstring.cpp | 2 +- protocols/IcqOscarJ/src/fam_13servclist.cpp | 6 ++-- protocols/IcqOscarJ/src/icq_xstatus.cpp | 14 ++++---- protocols/IcqOscarJ/src/log.cpp | 2 +- protocols/IcqOscarJ/src/userinfotab.cpp | 6 ++-- protocols/JabberG/src/jabber_console.cpp | 2 +- protocols/JabberG/src/jabber_disco.cpp | 30 ++++++++--------- protocols/JabberG/src/jabber_file.cpp | 2 +- protocols/JabberG/src/jabber_groupchat.cpp | 16 ++++----- protocols/JabberG/src/jabber_iq_handlers.cpp | 2 +- protocols/JabberG/src/jabber_misc.cpp | 6 ++-- protocols/JabberG/src/jabber_notes.cpp | 2 +- protocols/JabberG/src/jabber_secur.cpp | 4 +-- protocols/JabberG/src/jabber_util.cpp | 6 ++-- protocols/JabberG/src/jabber_vcard.cpp | 44 ++++++++++++------------ protocols/JabberG/src/jabber_xstatus.cpp | 30 ++++++++--------- protocols/MRA/src/Mra_functions.cpp | 2 +- protocols/MRA/src/Mra_svcs.cpp | 2 +- protocols/MSN/src/msn_contact.cpp | 6 ++-- protocols/MSN/src/msn_mail.cpp | 4 +-- protocols/MSN/src/msn_misc.cpp | 20 +++++------ protocols/MSN/src/msn_soapab.cpp | 2 +- protocols/Omegle/src/communication.cpp | 8 ++--- protocols/Sametime/src/userlist.cpp | 16 ++++----- protocols/SkypeWeb/src/skype_events.cpp | 12 +++---- protocols/Tlen/src/tlen_iqid.cpp | 2 +- protocols/Tlen/src/tlen_muc.cpp | 2 +- protocols/Tlen/src/tlen_p2p_old.cpp | 6 ++-- protocols/Tlen/src/tlen_thread.cpp | 2 +- protocols/Tlen/src/tlen_voice.cpp | 4 +-- protocols/Tox/src/tox_multimedia.cpp | 2 +- protocols/Tox/src/tox_network.cpp | 8 ++--- protocols/Tox/src/tox_options.cpp | 24 ++++++------- protocols/Twitter/src/ui.cpp | 6 ++-- protocols/VKontakte/src/vk_proto.cpp | 50 ++++++++++++++-------------- protocols/Xfire/src/SHA1.cpp | 8 ++--- protocols/Xfire/src/clientloginpacket.cpp | 4 +-- protocols/Xfire/src/tools.cpp | 4 +-- protocols/Yahoo/src/util.cpp | 2 +- protocols/Yahoo/src/yahoo.h | 7 ++-- 51 files changed, 221 insertions(+), 224 deletions(-) (limited to 'protocols') diff --git a/protocols/FacebookRM/src/events.cpp b/protocols/FacebookRM/src/events.cpp index da46bbe96b..624a9e9a84 100644 --- a/protocols/FacebookRM/src/events.cpp +++ b/protocols/FacebookRM/src/events.cpp @@ -34,14 +34,14 @@ HWND FacebookProto::NotifyEvent(TCHAR* title, TCHAR* info, MCONTACT contact, DWO case FACEBOOK_EVENT_CLIENT: if (!getByte(FACEBOOK_KEY_EVENT_CLIENT_ENABLE, DEFAULT_EVENT_CLIENT_ENABLE)) return NULL; - mir_snprintf(name, SIZEOF(name), "%s_%s", m_szModuleName, "Client"); + mir_snprintf(name, "%s_%s", m_szModuleName, "Client"); flags |= NIIF_WARNING; break; case FACEBOOK_EVENT_NEWSFEED: if (!getByte(FACEBOOK_KEY_EVENT_FEEDS_ENABLE, DEFAULT_EVENT_FEEDS_ENABLE)) return NULL; - mir_snprintf(name, SIZEOF(name), "%s_%s", m_szModuleName, "Newsfeed"); + mir_snprintf(name, "%s_%s", m_szModuleName, "Newsfeed"); SkinPlaySound("NewsFeed"); flags |= NIIF_INFO; break; @@ -49,7 +49,7 @@ HWND FacebookProto::NotifyEvent(TCHAR* title, TCHAR* info, MCONTACT contact, DWO case FACEBOOK_EVENT_NOTIFICATION: if (!getByte(FACEBOOK_KEY_EVENT_NOTIFICATIONS_ENABLE, DEFAULT_EVENT_NOTIFICATIONS_ENABLE)) return NULL; - mir_snprintf(name, SIZEOF(name), "%s_%s", m_szModuleName, "Notification"); + mir_snprintf(name, "%s_%s", m_szModuleName, "Notification"); SkinPlaySound("Notification"); flags |= NIIF_INFO; break; @@ -57,7 +57,7 @@ HWND FacebookProto::NotifyEvent(TCHAR* title, TCHAR* info, MCONTACT contact, DWO case FACEBOOK_EVENT_OTHER: if (!getByte(FACEBOOK_KEY_EVENT_OTHER_ENABLE, DEFAULT_EVENT_OTHER_ENABLE)) return NULL; - mir_snprintf(name, SIZEOF(name), "%s_%s", m_szModuleName, "Other"); + mir_snprintf(name, "%s_%s", m_szModuleName, "Other"); SkinPlaySound("OtherEvent"); flags |= NIIF_INFO; break; @@ -65,7 +65,7 @@ HWND FacebookProto::NotifyEvent(TCHAR* title, TCHAR* info, MCONTACT contact, DWO case FACEBOOK_EVENT_FRIENDSHIP: if (!getByte(FACEBOOK_KEY_EVENT_FRIENDSHIP_ENABLE, DEFAULT_EVENT_FRIENDSHIP_ENABLE)) return NULL; - mir_snprintf(name, SIZEOF(name), "%s_%s", m_szModuleName, "Friendship"); + mir_snprintf(name, "%s_%s", m_szModuleName, "Friendship"); SkinPlaySound("Friendship"); flags |= NIIF_INFO; break; @@ -73,7 +73,7 @@ HWND FacebookProto::NotifyEvent(TCHAR* title, TCHAR* info, MCONTACT contact, DWO case FACEBOOK_EVENT_TICKER: if (!getByte(FACEBOOK_KEY_EVENT_TICKER_ENABLE, DEFAULT_EVENT_TICKER_ENABLE)) return NULL; - mir_snprintf(name, SIZEOF(name), "%s_%s", m_szModuleName, "Ticker"); + mir_snprintf(name, "%s_%s", m_szModuleName, "Ticker"); SkinPlaySound("Ticker"); flags |= NIIF_INFO; break; diff --git a/protocols/FacebookRM/src/proto.cpp b/protocols/FacebookRM/src/proto.cpp index fee5b2d6f9..968a0c5c99 100644 --- a/protocols/FacebookRM/src/proto.cpp +++ b/protocols/FacebookRM/src/proto.cpp @@ -991,8 +991,8 @@ void FacebookProto::InitPopups() char name[256]; // Client - mir_sntprintf(desc, SIZEOF(desc), _T("%s/%s"), m_tszUserName, TranslateT("Client notifications")); - mir_snprintf(name, SIZEOF(name), "%s_%s", m_szModuleName, "Client"); + mir_sntprintf(desc, _T("%s/%s"), m_tszUserName, TranslateT("Client notifications")); + mir_snprintf(name, "%s_%s", m_szModuleName, "Client"); ppc.ptszDescription = desc; ppc.pszName = name; ppc.hIcon = Skin_GetIconByHandle(GetIconHandle("facebook")); @@ -1002,8 +1002,8 @@ void FacebookProto::InitPopups() popupClasses.push_back(Popup_RegisterClass(&ppc)); // Newsfeeds - mir_sntprintf(desc, SIZEOF(desc), _T("%s/%s"), m_tszUserName, TranslateT("News feeds")); - mir_snprintf(name, SIZEOF(name), "%s_%s", m_szModuleName, "Newsfeed"); + mir_sntprintf(desc, _T("%s/%s"), m_tszUserName, TranslateT("News feeds")); + mir_snprintf(name, "%s_%s", m_szModuleName, "Newsfeed"); ppc.ptszDescription = desc; ppc.pszName = name; ppc.hIcon = Skin_GetIconByHandle(GetIconHandle("newsfeed")); @@ -1013,8 +1013,8 @@ void FacebookProto::InitPopups() popupClasses.push_back(Popup_RegisterClass(&ppc)); // Notifications - mir_sntprintf(desc, SIZEOF(desc), _T("%s/%s"), m_tszUserName, TranslateT("Notifications")); - mir_snprintf(name, SIZEOF(name), "%s_%s", m_szModuleName, "Notification"); + mir_sntprintf(desc, _T("%s/%s"), m_tszUserName, TranslateT("Notifications")); + mir_snprintf(name, "%s_%s", m_szModuleName, "Notification"); ppc.ptszDescription = desc; ppc.pszName = name; ppc.hIcon = Skin_GetIconByHandle(GetIconHandle("notification")); @@ -1024,8 +1024,8 @@ void FacebookProto::InitPopups() popupClasses.push_back(Popup_RegisterClass(&ppc)); // Others - mir_sntprintf(desc, SIZEOF(desc), _T("%s/%s"), m_tszUserName, TranslateT("Other events")); - mir_snprintf(name, SIZEOF(name), "%s_%s", m_szModuleName, "Other"); + mir_sntprintf(desc, _T("%s/%s"), m_tszUserName, TranslateT("Other events")); + mir_snprintf(name, "%s_%s", m_szModuleName, "Other"); ppc.ptszDescription = desc; ppc.pszName = name; ppc.hIcon = Skin_GetIconByHandle(GetIconHandle("facebook")); @@ -1035,8 +1035,8 @@ void FacebookProto::InitPopups() popupClasses.push_back(Popup_RegisterClass(&ppc)); // Friendship changes - mir_sntprintf(desc, SIZEOF(desc), _T("%s/%s"), m_tszUserName, TranslateT("Friendship events")); - mir_snprintf(name, SIZEOF(name), "%s_%s", m_szModuleName, "Friendship"); + mir_sntprintf(desc, _T("%s/%s"), m_tszUserName, TranslateT("Friendship events")); + mir_snprintf(name, "%s_%s", m_szModuleName, "Friendship"); ppc.ptszDescription = desc; ppc.pszName = name; ppc.hIcon = Skin_GetIconByHandle(GetIconHandle("friendship")); @@ -1046,8 +1046,8 @@ void FacebookProto::InitPopups() popupClasses.push_back(Popup_RegisterClass(&ppc)); // Ticker - mir_sntprintf(desc, SIZEOF(desc), _T("%s/%s"), m_tszUserName, TranslateT("Ticker feeds")); - mir_snprintf(name, SIZEOF(name), "%s_%s", m_szModuleName, "Ticker"); + mir_sntprintf(desc, _T("%s/%s"), m_tszUserName, TranslateT("Ticker feeds")); + mir_snprintf(name, "%s_%s", m_szModuleName, "Ticker"); ppc.ptszDescription = desc; ppc.pszName = name; ppc.hIcon = Skin_GetIconByHandle(GetIconHandle("newsfeed")); diff --git a/protocols/GTalkExt/src/avatar.cpp b/protocols/GTalkExt/src/avatar.cpp index 47d760cf70..833bfeef0a 100644 --- a/protocols/GTalkExt/src/avatar.cpp +++ b/protocols/GTalkExt/src/avatar.cpp @@ -45,7 +45,7 @@ LPTSTR CreateAvaFile(HANDLE *hFile) return NULL; TCHAR full[MAX_PATH + 2]; - mir_sntprintf(full, SIZEOF(full), AVA_FILE_NAME_FORMAT, path, name); + mir_sntprintf(full, AVA_FILE_NAME_FORMAT, path, name); CreateDirectoryTreeT(full); HANDLE h = CreateFile(full, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); diff --git a/protocols/GTalkExt/src/handlers.cpp b/protocols/GTalkExt/src/handlers.cpp index 16af0a823e..1aa2733414 100644 --- a/protocols/GTalkExt/src/handlers.cpp +++ b/protocols/GTalkExt/src/handlers.cpp @@ -189,7 +189,7 @@ void RequestMail(LPCTSTR jidWithRes, IJabberInterface *ji) lastThreadId(ReadJidSetting(LAST_THREAD_ID_FROM_JID, jid)); TCHAR id[30]; - mir_sntprintf(id, SIZEOF(id), JABBER_IQID_FORMAT, uID); + mir_sntprintf(id, JABBER_IQID_FORMAT, uID); xi.addAttr(node, ATTRNAME_ID, id); child = xi.addChild(node, NODENAME_QUERY, NULL); @@ -249,7 +249,7 @@ void SetNotificationSetting(LPCTSTR jidWithResource, IJabberInterface *ji) xi.addAttr(node, ATTRNAME_TO, jid); TCHAR id[30]; - mir_sntprintf(id, SIZEOF(id), JABBER_IQID_FORMAT, ji->SerialNext()); + mir_sntprintf(id, JABBER_IQID_FORMAT, ji->SerialNext()); xi.addAttr(node, ATTRNAME_ID, id); child = xi.addChild(node, NODENAME_USERSETTING, NULL); diff --git a/protocols/GTalkExt/src/inbox.cpp b/protocols/GTalkExt/src/inbox.cpp index 8db7427a0d..fcafd253b7 100644 --- a/protocols/GTalkExt/src/inbox.cpp +++ b/protocols/GTalkExt/src/inbox.cpp @@ -222,8 +222,8 @@ void OpenContactInbox(LPCSTR szModuleName) TCHAR buf[1024]; if (mir_tstrcmpi(host, COMMON_GMAIL_HOST1) && mir_tstrcmpi(host, COMMON_GMAIL_HOST2)) - mir_sntprintf(buf, SIZEOF(buf), INBOX_URL_FORMAT, _T("a/"), host); // hosted + mir_sntprintf(buf, INBOX_URL_FORMAT, _T("a/"), host); // hosted else - mir_sntprintf(buf, SIZEOF(buf), INBOX_URL_FORMAT, _T(""), _T("mail")); // common + mir_sntprintf(buf, INBOX_URL_FORMAT, _T(""), _T("mail")); // common OpenUrl(szModuleName, tszJid, buf); } diff --git a/protocols/GTalkExt/src/notifications.cpp b/protocols/GTalkExt/src/notifications.cpp index 9e3bd386e1..e7813894c1 100644 --- a/protocols/GTalkExt/src/notifications.cpp +++ b/protocols/GTalkExt/src/notifications.cpp @@ -254,7 +254,7 @@ void UnreadMailNotification(LPCSTR acc, LPCTSTR jid, LPCTSTR url, LPCTSTR unread POPUPDATAT data = { 0 }; FormatPseudocontactDisplayName(&data.lptzContactName[0], jid, unreadCount); - mir_sntprintf(data.lptzText, SIZEOF(data.lptzText), TranslateT("You've received an e-mail\n%s unread threads"), unreadCount); + mir_sntprintf(data.lptzText, TranslateT("You've received an e-mail\n%s unread threads"), unreadCount); ShowNotification(acc, &data, jid, url, unreadCount); } @@ -277,9 +277,9 @@ void UnreadThreadNotification(LPCSTR acc, LPCTSTR jid, LPCTSTR url, LPCTSTR unre } if (ReadCheckbox(0, IDC_ADDSNIP, (DWORD)TlsGetValue(itlsSettings))) - mir_sntprintf(data.lptzText, SIZEOF(data.lptzText), TranslateTS(FULL_NOTIFICATION_FORMAT), mtn->subj, tszSenders.c_str(), mtn->snip); + mir_sntprintf(data.lptzText, TranslateTS(FULL_NOTIFICATION_FORMAT), mtn->subj, tszSenders.c_str(), mtn->snip); else - mir_sntprintf(data.lptzText, SIZEOF(data.lptzText), TranslateTS(SHORT_NOTIFICATION_FORMAT), mtn->subj, tszSenders.c_str()); + mir_sntprintf(data.lptzText, TranslateTS(SHORT_NOTIFICATION_FORMAT), mtn->subj, tszSenders.c_str()); ShowNotification(acc, &data, jid, url, unreadCount); } diff --git a/protocols/GTalkExt/src/options.cpp b/protocols/GTalkExt/src/options.cpp index 053faf2bba..b15eb53042 100644 --- a/protocols/GTalkExt/src/options.cpp +++ b/protocols/GTalkExt/src/options.cpp @@ -157,8 +157,8 @@ INT_PTR CALLBACK AccOptionsDlgProc(HWND wnd, UINT msg, WPARAM wParam, LPARAM lPa void ShowTestPopup(HWND wnd) { POPUPDATAT data = { 0 }; - mir_sntprintf(data.lptzContactName, SIZEOF(data.lptzContactName), TranslateTS(TEST_LETTER_INBOX)); - mir_sntprintf(data.lptzText, SIZEOF(data.lptzText), TranslateTS(FULL_NOTIFICATION_FORMAT), TranslateTS(TEST_LETTER_SUBJECT), TranslateTS(TEST_LETTER_SENDER), TranslateTS(TEST_LETTER_SNIP)); + mir_sntprintf(data.lptzContactName, TranslateTS(TEST_LETTER_INBOX)); + mir_sntprintf(data.lptzText, TranslateTS(FULL_NOTIFICATION_FORMAT), TranslateTS(TEST_LETTER_SUBJECT), TranslateTS(TEST_LETTER_SENDER), TranslateTS(TEST_LETTER_SNIP)); int len = SendDlgItemMessage(wnd, IDC_TIMEOUTEDIT, WM_GETTEXTLENGTH, 0, 0) + 1; LPTSTR timeout = (LPTSTR)malloc(len * sizeof(TCHAR)); diff --git a/protocols/Gadu-Gadu/src/avatar.cpp b/protocols/Gadu-Gadu/src/avatar.cpp index 5e6b7b199a..1d27e336ed 100644 --- a/protocols/Gadu-Gadu/src/avatar.cpp +++ b/protocols/Gadu-Gadu/src/avatar.cpp @@ -61,7 +61,7 @@ bool GGPROTO::getAvatarFileInfo(uin_t uin, char **avatarurl, char **avatarts) *avatarurl = *avatarts = NULL; char szUrl[128]; - mir_snprintf(szUrl, SIZEOF(szUrl), "http://api.gadu-gadu.pl/avatars/%d/0.xml", uin); + mir_snprintf(szUrl, "http://api.gadu-gadu.pl/avatars/%d/0.xml", uin); NETLIBHTTPREQUEST req = { sizeof(req) }; req.requestType = REQUEST_GET; diff --git a/protocols/Gadu-Gadu/src/oauth.cpp b/protocols/Gadu-Gadu/src/oauth.cpp index 14fc85d6ce..8534d0e5cb 100644 --- a/protocols/Gadu-Gadu/src/oauth.cpp +++ b/protocols/Gadu-Gadu/src/oauth.cpp @@ -338,7 +338,7 @@ int GGPROTO::oauth_receivetoken() mir_free(str); str = oauth_uri_escape("http://www.mojageneracja.pl"); - mir_snprintf(szUrl, SIZEOF(szUrl), "callback_url=%s&request_token=%s&uin=%s&password=%s", + mir_snprintf(szUrl, "callback_url=%s&request_token=%s&uin=%s&password=%s", str, token, uin, password); mir_free(str); str = mir_strdup(szUrl); diff --git a/protocols/IRCG/src/clist.cpp b/protocols/IRCG/src/clist.cpp index 92fa0553df..210024ffc0 100644 --- a/protocols/IRCG/src/clist.cpp +++ b/protocols/IRCG/src/clist.cpp @@ -67,7 +67,7 @@ BOOL CIrcProto::CList_AddDCCChat(const CMString& name, const CMString& hostmask, cle.hDbEvent = -100; cle.flags = CLEF_TCHAR; cle.hIcon = LoadIconEx(IDI_DCC); - mir_snprintf(szService, SIZEOF(szService), "%s/DblClickEvent", m_szModuleName); + mir_snprintf(szService, "%s/DblClickEvent", m_szModuleName); cle.pszService = szService; mir_sntprintf(szNick, SIZEOF(szNick), TranslateT("CTCP chat request from %s"), name.c_str()); cle.ptszTooltip = szNick; diff --git a/protocols/IRCG/src/irclib.cpp b/protocols/IRCG/src/irclib.cpp index 9b333a5597..ca3f4aea60 100644 --- a/protocols/IRCG/src/irclib.cpp +++ b/protocols/IRCG/src/irclib.cpp @@ -1430,18 +1430,18 @@ LBL_Parse: char buf[1024 * 4]; if (iParamCnt != 2) - cbLen = mir_snprintf(buf, SIZEOF(buf), "%s : ERROR : UNKNOWN-ERROR\r\n", szBuf); + cbLen = mir_snprintf(buf, "%s : ERROR : UNKNOWN-ERROR\r\n", szBuf); else { for (int i = 0; i < g_Instances.getCount(); i++) { if (PeerPortNrRcvd == g_Instances[i]->m_info.iPort && LocalPortNrRcvd == g_Instances[i]->m_myLocalPort) { - cbLen = mir_snprintf(buf, SIZEOF(buf), "%s : USERID : %S : %S\r\n", + cbLen = mir_snprintf(buf, "%s : USERID : %S : %S\r\n", szBuf, g_Instances[i]->m_info.sIdentServerType.c_str(), g_Instances[i]->m_info.sUserID.c_str()); break; } } if (cbLen == 0) - cbLen = mir_snprintf(buf, SIZEOF(buf), "%s : ERROR : INVALID-PORT\r\n", szBuf); + cbLen = mir_snprintf(buf, "%s : ERROR : INVALID-PORT\r\n", szBuf); } if (Netlib_Send(hConnection, (const char*)buf, cbLen, 0) > 0) diff --git a/protocols/IcqOscarJ/src/editstring.cpp b/protocols/IcqOscarJ/src/editstring.cpp index f792660d52..2ea8f8eb1c 100644 --- a/protocols/IcqOscarJ/src/editstring.cpp +++ b/protocols/IcqOscarJ/src/editstring.cpp @@ -239,7 +239,7 @@ void ChangeInfoData::BeginStringEdit(int iItem, RECT *rc, int i, WORD wVKey) szValue = " "; else if ((si.displayType & LIM_TYPE) == LI_NUMBER) { szValue = str; - mir_snprintf(str, SIZEOF(str), "%d", sid.value); + mir_snprintf(str, "%d", sid.value); } else if (sid.value) { szValue = BinaryToEscapes((char*)sid.value); diff --git a/protocols/IcqOscarJ/src/fam_13servclist.cpp b/protocols/IcqOscarJ/src/fam_13servclist.cpp index fd917076b1..83e28ffa0f 100644 --- a/protocols/IcqOscarJ/src/fam_13servclist.cpp +++ b/protocols/IcqOscarJ/src/fam_13servclist.cpp @@ -1248,7 +1248,7 @@ void CIcqProto::handleServerCListItemUpdate(const char *szRecordName, WORD wItem char *nick = NickFromHandleUtf(hContact); setByte(hContact, "Auth", 0); - mir_snprintf(str, SIZEOF(str), ICQTranslateUtfStatic(LPGEN("Contact \"%s\" was authorized in the server list."), msg, SIZEOF(msg)), nick); + mir_snprintf(str, ICQTranslateUtfStatic(LPGEN("Contact \"%s\" was authorized in the server list."), msg, SIZEOF(msg)), nick); icq_LogMessage(LOG_WARNING, str); SAFE_FREE(&nick); } @@ -1258,7 +1258,7 @@ void CIcqProto::handleServerCListItemUpdate(const char *szRecordName, WORD wItem char *nick = NickFromHandleUtf(hContact); setByte(hContact, "Auth", 1); - mir_snprintf(str, SIZEOF(str), ICQTranslateUtfStatic(LPGEN("Contact \"%s\" lost its authorization in the server list."), msg, SIZEOF(msg)), nick); + mir_snprintf(str, ICQTranslateUtfStatic(LPGEN("Contact \"%s\" lost its authorization in the server list."), msg, SIZEOF(msg)), nick); icq_LogMessage(LOG_WARNING, str); SAFE_FREE(&nick); } @@ -1348,7 +1348,7 @@ void CIcqProto::handleServerCListItemDelete(const char *szRecordName, WORD wItem char msg[MAX_PATH]; char *nick = NickFromHandleUtf(hContact); - mir_snprintf(str, SIZEOF(str), ICQTranslateUtfStatic(LPGEN("User \"%s\" was removed from server list."), msg, SIZEOF(msg)), nick); + mir_snprintf(str, ICQTranslateUtfStatic(LPGEN("User \"%s\" was removed from server list."), msg, SIZEOF(msg)), nick); icq_LogMessage(LOG_WARNING, str); SAFE_FREE(&nick); } diff --git a/protocols/IcqOscarJ/src/icq_xstatus.cpp b/protocols/IcqOscarJ/src/icq_xstatus.cpp index a469c5ea39..e2a0ca4787 100644 --- a/protocols/IcqOscarJ/src/icq_xstatus.cpp +++ b/protocols/IcqOscarJ/src/icq_xstatus.cpp @@ -705,7 +705,7 @@ static INT_PTR CALLBACK SetXStatusDlgProc(HWND hwndDlg,UINT message,WPARAM wPara char buf[MAX_PATH]; char *format = GetWindowTextUtf(hwndDlg); - mir_snprintf(str, SIZEOF(str), format, dat->bXStatus?ICQTranslateUtfStatic(nameXStatus[dat->bXStatus-1], buf, MAX_PATH):""); + mir_snprintf(str, format, dat->bXStatus?ICQTranslateUtfStatic(nameXStatus[dat->bXStatus-1], buf, MAX_PATH):""); SetWindowTextUtf(hwndDlg, str); SAFE_FREE(&format); } @@ -743,14 +743,14 @@ static INT_PTR CALLBACK SetXStatusDlgProc(HWND hwndDlg,UINT message,WPARAM wPara dat->ppro->setByte(DBSETTING_XSTATUS_ID, dat->bXStatus); char *szValue = GetDlgItemTextUtf(hwndDlg,IDC_XMSG); - mir_snprintf(szSetting, SIZEOF(szSetting), "XStatus%dMsg", dat->bXStatus); + mir_snprintf(szSetting, "XStatus%dMsg", dat->bXStatus); db_set_utf(NULL, dat->ppro->m_szModuleName, szSetting, szValue); db_set_utf(NULL, dat->ppro->m_szModuleName, DBSETTING_XSTATUS_MSG, szValue); SAFE_FREE(&szValue); if (dat->ppro->m_bXStatusEnabled) { szValue = GetDlgItemTextUtf(hwndDlg,IDC_XTITLE); - mir_snprintf(szSetting, SIZEOF(szSetting), "XStatus%dName", dat->bXStatus); + mir_snprintf(szSetting, "XStatus%dName", dat->bXStatus); db_set_utf(NULL, dat->ppro->m_szModuleName, szSetting, szValue); db_set_utf(NULL, dat->ppro->m_szModuleName, DBSETTING_XSTATUS_NAME, szValue); SAFE_FREE(&szValue); @@ -796,13 +796,13 @@ void CIcqProto::setXStatusEx(BYTE bXStatus, BYTE bQuiet) char *szName = NULL, *szMsg = NULL; if (m_bXStatusEnabled) { - mir_snprintf(szSetting, SIZEOF(szSetting), "XStatus%dName", bXStatus); + mir_snprintf(szSetting, "XStatus%dName", bXStatus); szName = getSettingStringUtf(NULL, szSetting, ICQTranslateUtfStatic(nameXStatus[bXStatus-1], str, MAX_PATH)); } - mir_snprintf(szSetting, SIZEOF(szSetting), "XStatus%dMsg", bXStatus); + mir_snprintf(szSetting, "XStatus%dMsg", bXStatus); szMsg = getSettingStringUtf(NULL, szSetting, ""); - mir_snprintf(szSetting, SIZEOF(szSetting), "XStatus%dStat", bXStatus); + mir_snprintf(szSetting, "XStatus%dStat", bXStatus); if (!bQuiet && !getByte(szSetting, 0)) { InitXStatusData init; init.ppro = this; @@ -897,7 +897,7 @@ void InitXStatusIcons() for (int i = 0; i < XSTATUS_COUNT; i++) { char szTemp[100]; - mir_snprintf(szTemp, SIZEOF(szTemp), "icq_xstatus%d", i); + mir_snprintf(szTemp, "icq_xstatus%d", i); sid.pszName = szTemp; sid.pszDescription = (LPSTR)nameXStatus[i]; sid.iDefaultIndex = -(IDI_XSTATUS1+i); diff --git a/protocols/IcqOscarJ/src/log.cpp b/protocols/IcqOscarJ/src/log.cpp index c8439eeb6c..cd3b3297de 100644 --- a/protocols/IcqOscarJ/src/log.cpp +++ b/protocols/IcqOscarJ/src/log.cpp @@ -144,6 +144,6 @@ void CIcqProto::icq_LogFatalParam(const char *szMsg, WORD wError) char str[MAX_PATH]; char buf[MAX_PATH]; - mir_snprintf(buf, SIZEOF(buf), ICQTranslateUtfStatic(szMsg, str, SIZEOF(str)), wError); + mir_snprintf(buf, ICQTranslateUtfStatic(szMsg, str, SIZEOF(str)), wError); icq_LogMessage(LOG_FATAL, buf); } diff --git a/protocols/IcqOscarJ/src/userinfotab.cpp b/protocols/IcqOscarJ/src/userinfotab.cpp index af56e712b3..00dd66fac1 100644 --- a/protocols/IcqOscarJ/src/userinfotab.cpp +++ b/protocols/IcqOscarJ/src/userinfotab.cpp @@ -93,7 +93,7 @@ static void SetValue(CIcqProto* ppro, HWND hwndDlg, int idCtrl, MCONTACT hContac if (dbv.wVal != 0) { char szExtra[80]; - mir_snprintf(str, SIZEOF(str), "%d", dbv.wVal); + mir_snprintf(str, "%d", dbv.wVal); pstr = str; if (hContact && ppro->IsDirectConnectionOpen(hContact, DIRECTCONN_STANDARD, 1)) { @@ -114,7 +114,7 @@ static void SetValue(CIcqProto* ppro, HWND hwndDlg, int idCtrl, MCONTACT hContac if (pXName == NULL) // give default name pXName = ICQTranslateUtf(nameXStatus[bXStatus - 1]); - mir_snprintf(str, SIZEOF(str), "%s (%s)", pszStatus, pXName); + mir_snprintf(str, "%s (%s)", pszStatus, pXName); SAFE_FREE((void**)&pXName); } else strncpy_s(str, pszStatus, _TRUNCATE); @@ -235,7 +235,7 @@ static INT_PTR CALLBACK IcqDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM char str[MAX_PATH]; WORD v[4]; CallService(MS_SYSTEM_GETFILEVERSION, 0, (LPARAM)&v); - mir_snprintf(str, SIZEOF(str), "Miranda NG %d.%d.%d.%d (ICQ %s)", v[0], v[1], v[2], v[3], __VERSION_STRING_DOTS); + mir_snprintf(str, "Miranda NG %d.%d.%d.%d (ICQ %s)", v[0], v[1], v[2], v[3], __VERSION_STRING_DOTS); SetValue(ppro, hwndDlg, IDC_PORT, hContact, (char*)DBVT_WORD, (char*)ppro->wListenPort, SVS_ZEROISUNSPEC); SetValue(ppro, hwndDlg, IDC_VERSION, hContact, (char*)DBVT_WORD, (char*)ICQ_VERSION, SVS_ICQVERSION); diff --git a/protocols/JabberG/src/jabber_console.cpp b/protocols/JabberG/src/jabber_console.cpp index 2d9a44c235..57b968ce96 100644 --- a/protocols/JabberG/src/jabber_console.cpp +++ b/protocols/JabberG/src/jabber_console.cpp @@ -176,7 +176,7 @@ static void sttAppendBufW(StringBuf *buf, const WCHAR *str) tmp[0] = (char)*p; tmp[1] = 0; } - else mir_snprintf(tmp, SIZEOF(tmp), "\\u%d ?", (int)*p); + else mir_snprintf(tmp, "\\u%d ?", (int)*p); sttAppendBufRaw(buf, tmp); } diff --git a/protocols/JabberG/src/jabber_disco.cpp b/protocols/JabberG/src/jabber_disco.cpp index 4e1a452f77..b13aac36ff 100644 --- a/protocols/JabberG/src/jabber_disco.cpp +++ b/protocols/JabberG/src/jabber_disco.cpp @@ -441,14 +441,14 @@ void CJabberProto::PerformBrowse(HWND hwndDlg) int count = getDword("discoWnd_favCount", 0); for (int i=0; i < count; i++) { char setting[MAXMODULELABELLENGTH]; - mir_snprintf(setting, SIZEOF(setting), "discoWnd_favName_%d", i); + mir_snprintf(setting, "discoWnd_favName_%d", i); ptrT tszName( getTStringA(setting)); if (tszName == NULL) continue; - mir_snprintf(setting, SIZEOF(setting), "discoWnd_favJID_%d", i); + mir_snprintf(setting, "discoWnd_favJID_%d", i); ptrT dbvJid( getTStringA(setting)); - mir_snprintf(setting, SIZEOF(setting), "discoWnd_favNode_%d", i); + mir_snprintf(setting, "discoWnd_favNode_%d", i); ptrT dbvNode( getTStringA(setting)); CJabberSDNode *pNode = m_SDManager.AddPrimaryNode(dbvJid, dbvNode, tszName); SendBothRequests(pNode, NULL); @@ -798,7 +798,7 @@ void CJabberDlgDiscovery::btnBookmarks_OnClick(CCtrlButton *) int count = m_proto->getDword("discoWnd_favCount", 0); for (int i=0; i < count; i++) { char setting[MAXMODULELABELLENGTH]; - mir_snprintf(setting, SIZEOF(setting), "discoWnd_favName_%d", i); + mir_snprintf(setting, "discoWnd_favName_%d", i); ptrT tszName( m_proto->getTStringA(setting)); if (tszName != NULL) { HMENU hSubMenu = CreatePopupMenu(); @@ -832,11 +832,11 @@ void CJabberDlgDiscovery::btnBookmarks_OnClick(CCtrlButton *) if (res % 10) { res /= 10; char setting[MAXMODULELABELLENGTH]; - mir_snprintf(setting, SIZEOF(setting), "discoWnd_favName_%d", res); + mir_snprintf(setting, "discoWnd_favName_%d", res); m_proto->delSetting(setting); - mir_snprintf(setting, SIZEOF(setting), "discoWnd_favJID_%d", res); + mir_snprintf(setting, "discoWnd_favJID_%d", res); m_proto->delSetting(setting); - mir_snprintf(setting, SIZEOF(setting), "discoWnd_favNode_%d", res); + mir_snprintf(setting, "discoWnd_favNode_%d", res); m_proto->delSetting(setting); } else { @@ -846,11 +846,11 @@ void CJabberDlgDiscovery::btnBookmarks_OnClick(CCtrlButton *) SetDlgItemText(m_hwnd, IDC_COMBO_NODE, _T("")); char setting[MAXMODULELABELLENGTH]; - mir_snprintf(setting, SIZEOF(setting), "discoWnd_favJID_%d", res); + mir_snprintf(setting, "discoWnd_favJID_%d", res); ptrT dbv( m_proto->getTStringA(setting)); if (dbv) SetDlgItemText(m_hwnd, IDC_COMBO_JID, dbv); - mir_snprintf(setting, SIZEOF(setting), "discoWnd_favNode_%d", res); + mir_snprintf(setting, "discoWnd_favNode_%d", res); dbv = m_proto->getTStringA(setting); if (dbv) SetDlgItemText(m_hwnd, IDC_COMBO_NODE, dbv); @@ -861,11 +861,11 @@ void CJabberDlgDiscovery::btnBookmarks_OnClick(CCtrlButton *) int count = m_proto->getDword("discoWnd_favCount", 0); for (int i=0; i < count; i++) { char setting[MAXMODULELABELLENGTH]; - mir_snprintf(setting, SIZEOF(setting), "discoWnd_favName_%d", i); + mir_snprintf(setting, "discoWnd_favName_%d", i); m_proto->delSetting(setting); - mir_snprintf(setting, SIZEOF(setting), "discoWnd_favJID_%d", i); + mir_snprintf(setting, "discoWnd_favJID_%d", i); m_proto->delSetting(setting); - mir_snprintf(setting, SIZEOF(setting), "discoWnd_favNode_%d", i); + mir_snprintf(setting, "discoWnd_favNode_%d", i); m_proto->delSetting(setting); } m_proto->delSetting("discoWnd_favCount"); @@ -1334,11 +1334,11 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM { char setting[MAXMODULELABELLENGTH]; int count = getDword("discoWnd_favCount", 0); - mir_snprintf(setting, SIZEOF(setting), "discoWnd_favName_%d", count); + mir_snprintf(setting, "discoWnd_favName_%d", count); setTString(setting, pNode->GetName() ? pNode->GetName() : pNode->GetJid()); - mir_snprintf(setting, SIZEOF(setting), "discoWnd_favJID_%d", count); + mir_snprintf(setting, "discoWnd_favJID_%d", count); setTString(setting, pNode->GetJid()); - mir_snprintf(setting, SIZEOF(setting), "discoWnd_favNode_%d", count); + mir_snprintf(setting, "discoWnd_favNode_%d", count); setTString(setting, pNode->GetNode() ? pNode->GetNode() : _T("")); setDword("discoWnd_favCount", ++count); } diff --git a/protocols/JabberG/src/jabber_file.cpp b/protocols/JabberG/src/jabber_file.cpp index d962cac51e..d4bfc3dd61 100644 --- a/protocols/JabberG/src/jabber_file.cpp +++ b/protocols/JabberG/src/jabber_file.cpp @@ -48,7 +48,7 @@ void __cdecl CJabberProto::FileReceiveThread(filetransfer *ft) ft->s = info.s; char buffer[JABBER_NETWORK_BUFFER_SIZE]; - int datalen = mir_snprintf(buffer, SIZEOF(buffer), "GET /%s HTTP/1.1\r\nHost: %s\r\n\r\n", ft->httpPath, ft->httpHostName); + int datalen = mir_snprintf(buffer, "GET /%s HTTP/1.1\r\nHost: %s\r\n\r\n", ft->httpPath, ft->httpHostName); info.send(buffer, datalen); ft->state = FT_CONNECTING; diff --git a/protocols/JabberG/src/jabber_groupchat.cpp b/protocols/JabberG/src/jabber_groupchat.cpp index 4736324897..81b37b400e 100644 --- a/protocols/JabberG/src/jabber_groupchat.cpp +++ b/protocols/JabberG/src/jabber_groupchat.cpp @@ -119,16 +119,16 @@ struct JabberGcRecentInfo BOOL loadRecent(int iRecent) { char setting[MAXMODULELABELLENGTH]; - mir_snprintf(setting, SIZEOF(setting), "rcMuc_%d_server", iRecent); + mir_snprintf(setting, "rcMuc_%d_server", iRecent); server = ppro->getTStringA(setting); - mir_snprintf(setting, SIZEOF(setting), "rcMuc_%d_room", iRecent); + mir_snprintf(setting, "rcMuc_%d_room", iRecent); room = ppro->getTStringA(setting); - mir_snprintf(setting, SIZEOF(setting), "rcMuc_%d_nick", iRecent); + mir_snprintf(setting, "rcMuc_%d_nick", iRecent); nick = ppro->getTStringA(setting); - mir_snprintf(setting, SIZEOF(setting), "password_rcMuc_%d", iRecent); + mir_snprintf(setting, "password_rcMuc_%d", iRecent); password = ppro->getTStringA(NULL, setting); return room || server || nick || password; @@ -138,25 +138,25 @@ struct JabberGcRecentInfo { char setting[MAXMODULELABELLENGTH]; - mir_snprintf(setting, SIZEOF(setting), "rcMuc_%d_server", iRecent); + mir_snprintf(setting, "rcMuc_%d_server", iRecent); if (server) ppro->setTString(setting, server); else ppro->delSetting(setting); - mir_snprintf(setting, SIZEOF(setting), "rcMuc_%d_room", iRecent); + mir_snprintf(setting, "rcMuc_%d_room", iRecent); if (room) ppro->setTString(setting, room); else ppro->delSetting(setting); - mir_snprintf(setting, SIZEOF(setting), "rcMuc_%d_nick", iRecent); + mir_snprintf(setting, "rcMuc_%d_nick", iRecent); if (nick) ppro->setTString(setting, nick); else ppro->delSetting(setting); - mir_snprintf(setting, SIZEOF(setting), "password_rcMuc_%d", iRecent); + mir_snprintf(setting, "password_rcMuc_%d", iRecent); if (password) ppro->setTString(setting, password); else diff --git a/protocols/JabberG/src/jabber_iq_handlers.cpp b/protocols/JabberG/src/jabber_iq_handlers.cpp index 131a3b0ced..252da69c2f 100644 --- a/protocols/JabberG/src/jabber_iq_handlers.cpp +++ b/protocols/JabberG/src/jabber_iq_handlers.cpp @@ -741,7 +741,7 @@ BOOL CJabberProto::OnHandleDiscoItemsRequest(HXML iqNode, CJabberIqInfo *pInfo) BOOL CJabberProto::AddClistHttpAuthEvent(CJabberHttpAuthParams *pParams) { char szService[256]; - mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, JS_HTTP_AUTH); + mir_snprintf(szService, "%s%s", m_szModuleName, JS_HTTP_AUTH); CLISTEVENT cle = { 0 }; cle.cbSize = sizeof(CLISTEVENT); diff --git a/protocols/JabberG/src/jabber_misc.cpp b/protocols/JabberG/src/jabber_misc.cpp index 8927b0f816..a51eefa6a2 100644 --- a/protocols/JabberG/src/jabber_misc.cpp +++ b/protocols/JabberG/src/jabber_misc.cpp @@ -462,10 +462,10 @@ void CJabberProto::SetContactOfflineStatus(MCONTACT hContact) void CJabberProto::InitPopups(void) { TCHAR desc[256]; - mir_sntprintf(desc, SIZEOF(desc), _T("%s %s"), m_tszUserName, TranslateT("Errors")); + mir_sntprintf(desc, _T("%s %s"), m_tszUserName, TranslateT("Errors")); char name[256]; - mir_snprintf(name, SIZEOF(name), "%s_%s", m_szModuleName, "Error"); + mir_snprintf(name, "%s_%s", m_szModuleName, "Error"); POPUPCLASS ppc = { sizeof(ppc) }; ppc.flags = PCF_TCHAR; @@ -490,7 +490,7 @@ void CJabberProto::MsgPopup(MCONTACT hContact, const TCHAR *szMsg, const TCHAR * ppd.ptszText = szMsg; ppd.pszClassName = name; ppd.hContact = hContact; - mir_snprintf(name, SIZEOF(name), "%s_%s", m_szModuleName, "Error"); + mir_snprintf(name, "%s_%s", m_szModuleName, "Error"); CallService(MS_POPUP_ADDPOPUPCLASS, 0, (LPARAM)&ppd); } diff --git a/protocols/JabberG/src/jabber_notes.cpp b/protocols/JabberG/src/jabber_notes.cpp index c993dc746b..e493e54c0d 100644 --- a/protocols/JabberG/src/jabber_notes.cpp +++ b/protocols/JabberG/src/jabber_notes.cpp @@ -780,7 +780,7 @@ bool CJabberProto::OnIncomingNote(const TCHAR *szFrom, HXML hXml) CLISTEVENT cle = { 0 }; char szService[256]; - mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, JS_INCOMING_NOTE_EVENT); + mir_snprintf(szService, "%s%s", m_szModuleName, JS_INCOMING_NOTE_EVENT); cle.cbSize = sizeof(CLISTEVENT); cle.hIcon = (HICON)LoadIconEx("notes"); cle.flags = CLEF_PROTOCOLGLOBAL | CLEF_TCHAR; diff --git a/protocols/JabberG/src/jabber_secur.cpp b/protocols/JabberG/src/jabber_secur.cpp index a364050197..5bebb8ac3a 100644 --- a/protocols/JabberG/src/jabber_secur.cpp +++ b/protocols/JabberG/src/jabber_secur.cpp @@ -297,7 +297,7 @@ char* TScramAuth::getChallenge(const TCHAR *challenge) char buf[4096]; ptrA encproof(mir_base64_encode((PBYTE)clientProof, sizeof(clientProof))); - int cbLen = mir_snprintf(buf, SIZEOF(buf), "c=biws,r=%s,p=%s", snonce, encproof); + int cbLen = mir_snprintf(buf, "c=biws,r=%s,p=%s", snonce, encproof); return mir_base64_encode((PBYTE)buf, cbLen); } @@ -310,7 +310,7 @@ char* TScramAuth::getInitialRequest() cnonce = mir_base64_encode((PBYTE)nonce, sizeof(nonce)); char buf[4096]; - int cbLen = mir_snprintf(buf, SIZEOF(buf), "n,,n=%s,r=%s", uname, cnonce); + int cbLen = mir_snprintf(buf, "n,,n=%s,r=%s", uname, cnonce); msg1 = mir_strdup(buf + 3); return mir_base64_encode((PBYTE)buf, cbLen); } diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp index b6a142b90f..662240451c 100644 --- a/protocols/JabberG/src/jabber_util.cpp +++ b/protocols/JabberG/src/jabber_util.cpp @@ -692,7 +692,7 @@ void CJabberProto::ComboLoadRecentStrings(HWND hwndDlg, UINT idcCombo, char *par { for (int i = 0; i < recentCount; i++) { char setting[MAXMODULELABELLENGTH]; - mir_snprintf(setting, SIZEOF(setting), "%s%d", param, i); + mir_snprintf(setting, "%s%d", param, i); ptrT tszRecent(getTStringA(setting)); if (tszRecent != NULL) SendDlgItemMessage(hwndDlg, idcCombo, CB_ADDSTRING, 0, tszRecent); @@ -716,7 +716,7 @@ void CJabberProto::ComboAddRecentString(HWND hwndDlg, UINT idcCombo, char *param id = getByte(param, 0); char setting[MAXMODULELABELLENGTH]; - mir_snprintf(setting, SIZEOF(setting), "%s%d", param, id); + mir_snprintf(setting, "%s%d", param, id); setTString(setting, string); setByte(param, (id + 1) % recentCount); } @@ -769,7 +769,7 @@ static VOID CALLBACK sttRebuildInfoFrameApcProc(void* param) char name[128]; char *jid_copy = mir_t2a(item->jid); - mir_snprintf(name, SIZEOF(name), "$/Transports/%s", jid_copy); + mir_snprintf(name, "$/Transports/%s", jid_copy); ppro->m_pInfoFrame->CreateInfoItem(name, true, hContact); ppro->m_pInfoFrame->UpdateInfoItem(name, ppro->GetIconHandle(IDI_TRANSPORTL), (TCHAR *)item->jid); ppro->m_pInfoFrame->SetInfoItemCallback(name, &CJabberProto::InfoFrame_OnTransport); diff --git a/protocols/JabberG/src/jabber_vcard.cpp b/protocols/JabberG/src/jabber_vcard.cpp index c4860f67ad..510abac8ac 100644 --- a/protocols/JabberG/src/jabber_vcard.cpp +++ b/protocols/JabberG/src/jabber_vcard.cpp @@ -552,12 +552,12 @@ static INT_PTR CALLBACK EditEmailDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, SetWindowText(hwndDlg, TranslateT("Jabber vCard: Edit Email Address")); char idstr[33]; - mir_snprintf(idstr, SIZEOF(idstr), "e-mail%d", dat->id); + mir_snprintf(idstr, "e-mail%d", dat->id); ptrA email(dat->ppro->getStringA(idstr)); if (email != NULL) SetDlgItemTextA(hwndDlg, IDC_EMAIL, email); - mir_snprintf(idstr, SIZEOF(idstr), "e-mailFlag%d", lParam); + mir_snprintf(idstr, "e-mailFlag%d", lParam); WORD nFlag = dat->ppro->getWord(idstr, 0); if (nFlag & JABBER_VCEMAIL_HOME) CheckDlgButton(hwndDlg, IDC_HOME, BST_CHECKED); if (nFlag & JABBER_VCEMAIL_WORK) CheckDlgButton(hwndDlg, IDC_WORK, BST_CHECKED); @@ -573,14 +573,14 @@ static INT_PTR CALLBACK EditEmailDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, if (dat->id < 0) for (dat->id = 0;; dat->id++) { - mir_snprintf(idstr, SIZEOF(idstr), "e-mail%d", dat->id); + mir_snprintf(idstr, "e-mail%d", dat->id); if (ptrA(dat->ppro->getStringA(idstr)) == NULL) break; } TCHAR text[128]; GetDlgItemText(hwndDlg, IDC_EMAIL, text, SIZEOF(text)); - mir_snprintf(idstr, SIZEOF(idstr), "e-mail%d", dat->id); + mir_snprintf(idstr, "e-mail%d", dat->id); dat->ppro->setTString(idstr, text); { WORD nFlag = 0; @@ -588,7 +588,7 @@ static INT_PTR CALLBACK EditEmailDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, if (IsDlgButtonChecked(hwndDlg, IDC_WORK)) nFlag |= JABBER_VCEMAIL_WORK; if (IsDlgButtonChecked(hwndDlg, IDC_INTERNET)) nFlag |= JABBER_VCEMAIL_INTERNET; if (IsDlgButtonChecked(hwndDlg, IDC_X400)) nFlag |= JABBER_VCEMAIL_X400; - mir_snprintf(idstr, SIZEOF(idstr), "e-mailFlag%d", dat->id); + mir_snprintf(idstr, "e-mailFlag%d", dat->id); dat->ppro->setWord(idstr, nFlag); } // fall through @@ -614,12 +614,12 @@ static INT_PTR CALLBACK EditPhoneDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, SetWindowText(hwndDlg, TranslateT("Jabber vCard: Edit Phone Number")); char idstr[33]; - mir_snprintf(idstr, SIZEOF(idstr), "Phone%d", dat->id); + mir_snprintf(idstr, "Phone%d", dat->id); ptrA phone(dat->ppro->getStringA(idstr)); if (phone != NULL) SetDlgItemTextA(hwndDlg, IDC_PHONE, phone); - mir_snprintf(idstr, SIZEOF(idstr), "PhoneFlag%d", dat->id); + mir_snprintf(idstr, "PhoneFlag%d", dat->id); int nFlag = dat->ppro->getWord(idstr, 0); if (nFlag & JABBER_VCTEL_HOME) CheckDlgButton(hwndDlg, IDC_HOME, BST_CHECKED); if (nFlag & JABBER_VCTEL_WORK) CheckDlgButton(hwndDlg, IDC_WORK, BST_CHECKED); @@ -644,14 +644,14 @@ static INT_PTR CALLBACK EditPhoneDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, if (dat->id < 0) for (dat->id = 0;; dat->id++) { - mir_snprintf(idstr, SIZEOF(idstr), "Phone%d", dat->id); + mir_snprintf(idstr, "Phone%d", dat->id); if (ptrA(dat->ppro->getStringA(idstr)) == NULL) break; } char text[128]; GetDlgItemTextA(hwndDlg, IDC_PHONE, text, SIZEOF(text)); - mir_snprintf(idstr, SIZEOF(idstr), "Phone%d", dat->id); + mir_snprintf(idstr, "Phone%d", dat->id); dat->ppro->setString(idstr, text); WORD nFlag = 0; @@ -667,7 +667,7 @@ static INT_PTR CALLBACK EditPhoneDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, if (IsDlgButtonChecked(hwndDlg, IDC_MODEM)) nFlag |= JABBER_VCTEL_MODEM; if (IsDlgButtonChecked(hwndDlg, IDC_ISDN)) nFlag |= JABBER_VCTEL_ISDN; if (IsDlgButtonChecked(hwndDlg, IDC_PCS)) nFlag |= JABBER_VCTEL_PCS; - mir_snprintf(idstr, SIZEOF(idstr), "PhoneFlag%d", dat->id); + mir_snprintf(idstr, "PhoneFlag%d", dat->id); dat->ppro->setWord(idstr, nFlag); } // fall through @@ -729,7 +729,7 @@ static INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM, LPARAM lP lvi.iSubItem = 0; lvi.iItem = 0; for (i=0;;i++) { - mir_snprintf(idstr, SIZEOF(idstr), "e-mail%d", i); + mir_snprintf(idstr, "e-mail%d", i); ptrT email( ppro->getTStringA(idstr)); if (email == NULL) break; @@ -750,7 +750,7 @@ static INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM, LPARAM lP lvi.iSubItem = 0; lvi.iItem = 0; for (i=0;;i++) { - mir_snprintf(idstr, SIZEOF(idstr), "Phone%d", i); + mir_snprintf(idstr, "Phone%d", i); ptrT phone( ppro->getTStringA(idstr)); if (phone == NULL) break; @@ -860,20 +860,20 @@ static INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM, LPARAM lP int i; for (i = lvi.lParam;; i++) { - mir_snprintf(idstr, SIZEOF(idstr), szIdTemplate, i + 1); + mir_snprintf(idstr, szIdTemplate, i + 1); ptrA fieldVal(ppro->getStringA(idstr)); if (fieldVal == NULL) break; - mir_snprintf(idstr, SIZEOF(idstr), szIdTemplate, i); + mir_snprintf(idstr, szIdTemplate, i); ppro->setString(idstr, fieldVal); - mir_snprintf(idstr, SIZEOF(idstr), szFlagTemplate, i + 1); + mir_snprintf(idstr, szFlagTemplate, i + 1); WORD nFlag = ppro->getWord(idstr, 0); - mir_snprintf(idstr, SIZEOF(idstr), szFlagTemplate, i); + mir_snprintf(idstr, szFlagTemplate, i); ppro->setWord(idstr, nFlag); } - mir_snprintf(idstr, SIZEOF(idstr), szIdTemplate, i); + mir_snprintf(idstr, szIdTemplate, i); ppro->delSetting(idstr); - mir_snprintf(idstr, SIZEOF(idstr), szFlagTemplate, i); + mir_snprintf(idstr, szFlagTemplate, i); ppro->delSetting(idstr); SendMessage(hwndDlg, M_REMAKELISTS, 0, 0); ppro->m_vCardUpdates |= (1UL << iPageId); @@ -1032,7 +1032,7 @@ void CJabberProto::SetServerVcard(BOOL bPhotoChanged, TCHAR* szPhotoFileName) AppendVcardFromDB(v, "GENDER", "GenderString"); for (i = 0;; i++) { - mir_snprintf(idstr, SIZEOF(idstr), "e-mail%d", i); + mir_snprintf(idstr, "e-mail%d", i); ptrT email(getTStringA(idstr)); if (email == NULL) break; @@ -1040,7 +1040,7 @@ void CJabberProto::SetServerVcard(BOOL bPhotoChanged, TCHAR* szPhotoFileName) HXML e = v << XCHILD(_T("EMAIL"), email); AppendVcardFromDB(e, "USERID", idstr); - mir_snprintf(idstr, SIZEOF(idstr), "e-mailFlag%d", i); + mir_snprintf(idstr, "e-mailFlag%d", i); WORD nFlag = getWord(idstr, 0); if (nFlag & JABBER_VCEMAIL_HOME) e << XCHILD(_T("HOME")); if (nFlag & JABBER_VCEMAIL_WORK) e << XCHILD(_T("WORK")); @@ -1080,7 +1080,7 @@ void CJabberProto::SetServerVcard(BOOL bPhotoChanged, TCHAR* szPhotoFileName) AppendVcardFromDB(v, "DESC", "About"); for (i = 0;; i++) { - mir_snprintf(idstr, SIZEOF(idstr), "Phone%d", i); + mir_snprintf(idstr, "Phone%d", i); ptrT phone(getTStringA(idstr)); if (phone == NULL) break; @@ -1088,7 +1088,7 @@ void CJabberProto::SetServerVcard(BOOL bPhotoChanged, TCHAR* szPhotoFileName) n = v << XCHILD(_T("TEL")); AppendVcardFromDB(n, "NUMBER", idstr); - mir_snprintf(idstr, SIZEOF(idstr), "PhoneFlag%d", i); + mir_snprintf(idstr, "PhoneFlag%d", i); WORD nFlag = getWord(idstr, 0); if (nFlag & JABBER_VCTEL_HOME) n << XCHILD(_T("HOME")); if (nFlag & JABBER_VCTEL_WORK) n << XCHILD(_T("WORK")); diff --git a/protocols/JabberG/src/jabber_xstatus.cpp b/protocols/JabberG/src/jabber_xstatus.cpp index 49f1bd03a5..473f0b5292 100644 --- a/protocols/JabberG/src/jabber_xstatus.cpp +++ b/protocols/JabberG/src/jabber_xstatus.cpp @@ -276,14 +276,14 @@ void CJabberDlgPepSimple::cbModes_OnChange(CCtrlData *) if ((m_prevSelected >= 0) && (m_modes[m_cbModes.GetItemData(m_prevSelected)].m_id >= 0)) { TCHAR *txt = m_txtDescription.GetText(); - mir_snprintf(szSetting, SIZEOF(szSetting), "PepMsg_%s", m_modes[m_cbModes.GetItemData(m_prevSelected)].m_name); + mir_snprintf(szSetting, "PepMsg_%s", m_modes[m_cbModes.GetItemData(m_prevSelected)].m_name); m_proto->setTString(szSetting, txt); mir_free(txt); } m_prevSelected = m_cbModes.GetCurSel(); if ((m_prevSelected >= 0) && (m_modes[m_cbModes.GetItemData(m_prevSelected)].m_id >= 0)) { - mir_snprintf(szSetting, SIZEOF(szSetting), "PepMsg_%s", m_modes[m_cbModes.GetItemData(m_prevSelected)].m_name); + mir_snprintf(szSetting, "PepMsg_%s", m_modes[m_cbModes.GetItemData(m_prevSelected)].m_name); ptrT szDescr( m_proto->getTStringA(szSetting)); m_txtDescription.SetText((szDescr != NULL) ? szDescr : _T("")); @@ -447,7 +447,7 @@ CPepGuiService::~CPepGuiService() void CPepGuiService::InitGui() { char szService[128]; - mir_snprintf(szService, SIZEOF(szService), "%s/AdvStatusSet/%s", m_proto->m_szModuleName, m_name); + mir_snprintf(szService, "%s/AdvStatusSet/%s", m_proto->m_szModuleName, m_name); int(__cdecl CPepGuiService::*serviceProc)(WPARAM, LPARAM); serviceProc = &CPepGuiService::OnMenuItemClick; @@ -463,7 +463,7 @@ void CPepGuiService::RebuildMenu() return; char szService[128]; - mir_snprintf(szService, SIZEOF(szService), "%s/AdvStatusSet/%s", m_proto->m_szModuleName, m_name); + mir_snprintf(szService, "%s/AdvStatusSet/%s", m_proto->m_szModuleName, m_name); CLISTMENUITEM mi = { sizeof(mi) }; mi.hParentMenu = hJabberRoot; @@ -1446,7 +1446,7 @@ INT_PTR __cdecl CJabberProto::OnSetXStatusEx(WPARAM, LPARAM lParam) void CJabberProto::RegisterAdvStatusSlot(const char *pszSlot) { char szSetting[256]; - mir_snprintf(szSetting, SIZEOF(szSetting), "AdvStatus/%s/%s", m_szModuleName, pszSlot); + mir_snprintf(szSetting, "AdvStatus/%s/%s", m_szModuleName, pszSlot); db_set_resident(szSetting, "id"); db_set_resident(szSetting, "icon"); db_set_resident(szSetting, "title"); @@ -1456,16 +1456,16 @@ void CJabberProto::RegisterAdvStatusSlot(const char *pszSlot) void CJabberProto::ResetAdvStatus(MCONTACT hContact, const char *pszSlot) { char szSetting[128]; - mir_snprintf(szSetting, SIZEOF(szSetting), "%s/%s/id", m_szModuleName, pszSlot); + mir_snprintf(szSetting, "%s/%s/id", m_szModuleName, pszSlot); db_unset(hContact, "AdvStatus", szSetting); - mir_snprintf(szSetting, SIZEOF(szSetting), "%s/%s/icon", m_szModuleName, pszSlot); + mir_snprintf(szSetting, "%s/%s/icon", m_szModuleName, pszSlot); db_unset(hContact, "AdvStatus", szSetting); - mir_snprintf(szSetting, SIZEOF(szSetting), "%s/%s/title", m_szModuleName, pszSlot); + mir_snprintf(szSetting, "%s/%s/title", m_szModuleName, pszSlot); db_unset(hContact, "AdvStatus", szSetting); - mir_snprintf(szSetting, SIZEOF(szSetting), "%s/%s/text", m_szModuleName, pszSlot); + mir_snprintf(szSetting, "%s/%s/text", m_szModuleName, pszSlot); db_unset(hContact, "AdvStatus", szSetting); } @@ -1473,16 +1473,16 @@ void CJabberProto::WriteAdvStatus(MCONTACT hContact, const char *pszSlot, const { char szSetting[128]; - mir_snprintf(szSetting, SIZEOF(szSetting), "%s/%s/id", m_szModuleName, pszSlot); + mir_snprintf(szSetting, "%s/%s/id", m_szModuleName, pszSlot); db_set_ts(hContact, "AdvStatus", szSetting, pszMode); - mir_snprintf(szSetting, SIZEOF(szSetting), "%s/%s/icon", m_szModuleName, pszSlot); + mir_snprintf(szSetting, "%s/%s/icon", m_szModuleName, pszSlot); db_set_s(hContact, "AdvStatus", szSetting, pszIcon); - mir_snprintf(szSetting, SIZEOF(szSetting), "%s/%s/title", m_szModuleName, pszSlot); + mir_snprintf(szSetting, "%s/%s/title", m_szModuleName, pszSlot); db_set_ts(hContact, "AdvStatus", szSetting, pszTitle); - mir_snprintf(szSetting, SIZEOF(szSetting), "%s/%s/text", m_szModuleName, pszSlot); + mir_snprintf(szSetting, "%s/%s/text", m_szModuleName, pszSlot); if (pszText) db_set_ts(hContact, "AdvStatus", szSetting, pszText); else @@ -1492,14 +1492,14 @@ void CJabberProto::WriteAdvStatus(MCONTACT hContact, const char *pszSlot, const char* CJabberProto::ReadAdvStatusA(MCONTACT hContact, const char *pszSlot, const char *pszValue) { char szSetting[128]; - mir_snprintf(szSetting, SIZEOF(szSetting), "%s/%s/%s", m_szModuleName, pszSlot, pszValue); + mir_snprintf(szSetting, "%s/%s/%s", m_szModuleName, pszSlot, pszValue); return db_get_sa(hContact, "AdvStatus", szSetting); } TCHAR* CJabberProto::ReadAdvStatusT(MCONTACT hContact, const char *pszSlot, const char *pszValue) { char szSetting[128]; - mir_snprintf(szSetting, SIZEOF(szSetting), "%s/%s/%s", m_szModuleName, pszSlot, pszValue); + mir_snprintf(szSetting, "%s/%s/%s", m_szModuleName, pszSlot, pszValue); return db_get_tsa(hContact, "AdvStatus", szSetting); } diff --git a/protocols/MRA/src/Mra_functions.cpp b/protocols/MRA/src/Mra_functions.cpp index d2f84ff04f..f7ef7aa58c 100644 --- a/protocols/MRA/src/Mra_functions.cpp +++ b/protocols/MRA/src/Mra_functions.cpp @@ -150,7 +150,7 @@ CMStringA MraAddrListGetToBuff(MRA_ADDR_LIST *pmalAddrList) CMStringA res; for (size_t i = 0; i < pmalAddrList->dwAddrCount; i++) { char buf[100]; - mir_snprintf(buf, SIZEOF(buf), "%s:%lu;", inet_ntoa((*((in_addr*)&pmalAddrList->pMailAddress[i].dwAddr))), pmalAddrList->pMailAddress[i].dwPort); + mir_snprintf(buf, "%s:%lu;", inet_ntoa((*((in_addr*)&pmalAddrList->pMailAddress[i].dwAddr))), pmalAddrList->pMailAddress[i].dwPort); res += buf; } diff --git a/protocols/MRA/src/Mra_svcs.cpp b/protocols/MRA/src/Mra_svcs.cpp index e97bfdf5ac..4d27ea4e4e 100644 --- a/protocols/MRA/src/Mra_svcs.cpp +++ b/protocols/MRA/src/Mra_svcs.cpp @@ -487,7 +487,7 @@ INT_PTR CMraProto::MraGetXStatusEx(WPARAM hContact, LPARAM lParam) // fill status message member if (pData->flags & CSSF_MASK_MESSAGE) { char szSetting[100]; - mir_snprintf(szSetting, SIZEOF(szSetting), "XStatus%dMsg", m_iXStatus); + mir_snprintf(szSetting, "XStatus%dMsg", m_iXStatus); if (pData->flags & CSSF_UNICODE) mraGetStaticStringW(hContact, szSetting, pData->pwszMessage, (STATUS_DESC_MAX + 1), NULL); else diff --git a/protocols/MSN/src/msn_contact.cpp b/protocols/MSN/src/msn_contact.cpp index b79ddcb6af..7ae6366836 100644 --- a/protocols/MSN/src/msn_contact.cpp +++ b/protocols/MSN/src/msn_contact.cpp @@ -113,13 +113,13 @@ void CMsnProto::AddDelUserContList(const char* email, const int list, const int if (list < LIST_RL) { const char* dom = strchr(email, '@'); if (dom == NULL) { - sz = mir_snprintf(buf, SIZEOF(buf), + sz = mir_snprintf(buf, "", email, list); } else { *(char*)dom = 0; - sz = mir_snprintf(buf, SIZEOF(buf), + sz = mir_snprintf(buf, "", dom + 1, email, list, netId); *(char*)dom = '@'; @@ -257,7 +257,7 @@ void CMsnProto::MSN_FindYahooUser(const char* email) size_t sz; *(char*)dom = '\0'; - sz = mir_snprintf(buf, SIZEOF(buf), "", dom + 1, email); + sz = mir_snprintf(buf, "", dom + 1, email); *(char*)dom = '@'; msnNsThread->sendPacket("FQY", "%d\r\n%s", sz, buf); } diff --git a/protocols/MSN/src/msn_mail.cpp b/protocols/MSN/src/msn_mail.cpp index 87587e24d0..10a968681d 100644 --- a/protocols/MSN/src/msn_mail.cpp +++ b/protocols/MSN/src/msn_mail.cpp @@ -295,7 +295,7 @@ void CMsnProto::sttNotificationMessage(char* msgBody, bool isInitial) cle.hIcon = LoadSkinnedIcon(SKINICON_OTHER_SENDEMAIL); cle.ptszTooltip = tBuffer2; char buf[64]; - mir_snprintf(buf, SIZEOF(buf), "%s%s", m_szModuleName, MS_GOTO_INBOX); + mir_snprintf(buf, "%s%s", m_szModuleName, MS_GOTO_INBOX); cle.pszService = buf; CallService(MS_CLIST_ADDEVENT, hContact, (LPARAM)&cle); @@ -317,7 +317,7 @@ void CMsnProto::sttNotificationMessage(char* msgBody, bool isInitial) msgurl = "inbox"; char szUrl[256]; - mir_snprintf(szUrl, SIZEOF(szUrl), "http://mail.live.com?rru=%s", msgurl); + mir_snprintf(szUrl, "http://mail.live.com?rru=%s", msgurl); MSN_ShowPopup(tBuffer, tBuffer2, MSN_ALLOW_ENTER | MSN_ALLOW_MSGBOX | MSN_HOTMAIL_POPUP, diff --git a/protocols/MSN/src/msn_misc.cpp b/protocols/MSN/src/msn_misc.cpp index b788bee022..2160bd233b 100644 --- a/protocols/MSN/src/msn_misc.cpp +++ b/protocols/MSN/src/msn_misc.cpp @@ -154,7 +154,7 @@ char* MSN_GetAvatarHash(char* szContext, char** pszUrl) if (i == 0) mir_strcpy(szSetting, "Url"); else - mir_snprintf(szSetting, SIZEOF(szSetting), "Url%d", i); + mir_snprintf(szSetting, "Url%d", i); pszUrlAttr = ezxml_attr(xmli, szSetting); if (pszUrlAttr == NULL) break; @@ -1021,15 +1021,15 @@ void CMsnProto::InitPopups(void) ppc.colorBack = RGB(173, 206, 247); ppc.colorText = GetSysColor(COLOR_WINDOWTEXT); ppc.iSeconds = 3; - mir_sntprintf(desc, SIZEOF(desc), _T("%s/%s"), m_tszUserName, TranslateT("Hotmail")); - mir_snprintf(name, SIZEOF(name), "%s_%s", m_szModuleName, "Hotmail"); + mir_sntprintf(desc, _T("%s/%s"), m_tszUserName, TranslateT("Hotmail")); + mir_snprintf(name, "%s_%s", m_szModuleName, "Hotmail"); hPopupHotmail = Popup_RegisterClass(&ppc); ppc.colorBack = RGB(173, 206, 247); ppc.colorText = GetSysColor(COLOR_WINDOWTEXT); ppc.iSeconds = 3; - mir_sntprintf(desc, SIZEOF(desc), _T("%s/%s"), m_tszUserName, TranslateT("Notify")); - mir_snprintf(name, SIZEOF(name), "%s_%s", m_szModuleName, "Notify"); + mir_sntprintf(desc, _T("%s/%s"), m_tszUserName, TranslateT("Notify")); + mir_snprintf(name, "%s_%s", m_szModuleName, "Notify"); hPopupNotify = Popup_RegisterClass(&ppc); ppc.hIcon = (HICON)LoadImage(NULL, IDI_WARNING, IMAGE_ICON, 0, 0, LR_SHARED); @@ -1037,8 +1037,8 @@ void CMsnProto::InitPopups(void) ppc.colorText = RGB(255, 245, 225); //Yellow ppc.iSeconds = 60; - mir_sntprintf(desc, SIZEOF(desc), _T("%s/%s"), m_tszUserName, TranslateT("Error")); - mir_snprintf(name, SIZEOF(name), "%s_%s", m_szModuleName, "Error"); + mir_sntprintf(desc, _T("%s/%s"), m_tszUserName, TranslateT("Error")); + mir_snprintf(name, "%s_%s", m_szModuleName, "Error"); hPopupError = Popup_RegisterClass(&ppc); } @@ -1073,11 +1073,11 @@ void CALLBACK sttMainThreadCallback(PVOID dwParam) ppd.pszClassName = name; if (pud->flags & MSN_SHOW_ERROR) - mir_snprintf(name, SIZEOF(name), "%s_%s", pud->proto->m_szModuleName, "Error"); + mir_snprintf(name, "%s_%s", pud->proto->m_szModuleName, "Error"); else if (pud->flags & (MSN_HOTMAIL_POPUP | MSN_ALERT_POPUP)) - mir_snprintf(name, SIZEOF(name), "%s_%s", pud->proto->m_szModuleName, "Hotmail"); + mir_snprintf(name, "%s_%s", pud->proto->m_szModuleName, "Hotmail"); else - mir_snprintf(name, SIZEOF(name), "%s_%s", pud->proto->m_szModuleName, "Notify"); + mir_snprintf(name, "%s_%s", pud->proto->m_szModuleName, "Notify"); CallService(MS_POPUP_ADDPOPUPCLASS, 0, (LPARAM)&ppd); } diff --git a/protocols/MSN/src/msn_soapab.cpp b/protocols/MSN/src/msn_soapab.cpp index 48afb659bd..02f1ead4d4 100644 --- a/protocols/MSN/src/msn_soapab.cpp +++ b/protocols/MSN/src/msn_soapab.cpp @@ -401,7 +401,7 @@ bool CMsnProto::MSN_SharingAddDelMember(const char* szEmail, const int listId, c ezxml_set_txt(node, "MSN.IM.BuddyType"); node = ezxml_add_child(anot, "Value", 0); - mir_snprintf(buf, SIZEOF(buf), "%02d:", netId); + mir_snprintf(buf, "%02d:", netId); ezxml_set_txt(node, buf); } diff --git a/protocols/Omegle/src/communication.cpp b/protocols/Omegle/src/communication.cpp index a0e1d19c0c..4998a0b344 100644 --- a/protocols/Omegle/src/communication.cpp +++ b/protocols/Omegle/src/communication.cpp @@ -361,7 +361,7 @@ bool Omegle_client::start() std::string count = get_page( OMEGLE_REQUEST_COUNT ); if (!count.empty()) { char str[255]; - mir_snprintf(str, SIZEOF(str), Translate("Connected to server %s. There are %s users online now."), server_.c_str(), count.c_str()); + mir_snprintf(str, Translate("Connected to server %s. There are %s users online now."), server_.c_str(), count.c_str()); TCHAR *msg = mir_a2t(str); parent->UpdateChat(NULL, msg); @@ -369,7 +369,7 @@ bool Omegle_client::start() } } else { char str[255]; - mir_snprintf(str, SIZEOF(str), Translate("Connected to server %s."), server_.c_str()); + mir_snprintf(str, Translate("Connected to server %s."), server_.c_str()); TCHAR *msg = mir_a2t(str); parent->UpdateChat(NULL, msg); @@ -481,7 +481,7 @@ bool Omegle_client::events() std::string count = utils::text::trim( resp.data.substr(pos, resp.data.find("]", pos) - pos)); char str[255]; - mir_snprintf(str, SIZEOF(str), Translate("On whole Omegle are %s strangers online now."), count.c_str()); + mir_snprintf(str, Translate("On whole Omegle are %s strangers online now."), count.c_str()); TCHAR *msg = mir_a2t_cp(str,CP_UTF8); parent->UpdateChat(NULL, msg); @@ -635,7 +635,7 @@ bool Omegle_client::events() resp.data.substr(pos, resp.data.find("\"]", pos) - pos) )) ); char str[255]; - mir_snprintf(str, SIZEOF(str), Translate("%s disconnected."), Translate(stranger.c_str())); + mir_snprintf(str, Translate("%s disconnected."), Translate(stranger.c_str())); TCHAR *msg = mir_a2t(str); parent->UpdateChat(NULL, msg); diff --git a/protocols/Sametime/src/userlist.cpp b/protocols/Sametime/src/userlist.cpp index 6d631fc2ce..a38c1e44d4 100644 --- a/protocols/Sametime/src/userlist.cpp +++ b/protocols/Sametime/src/userlist.cpp @@ -154,15 +154,15 @@ void CSametimeProto::ImportContactsFromList(mwSametimeList* user_list, bool temp group_type = mwSametimeGroup_getType(stgroup); group_open = (mwSametimeGroup_isOpen(stgroup) != 0); - mir_snprintf(buff, SIZEOF(buff), "GN_%s", group_alias); + mir_snprintf(buff, "GN_%s", group_alias); db_set_utf(0, szProtoGroups, buff, group_name); - mir_snprintf(buff, SIZEOF(buff), "GT_%s", group_alias); + mir_snprintf(buff, "GT_%s", group_alias); db_set_b(0, szProtoGroups, buff, (BYTE)group_type); - mir_snprintf(buff, SIZEOF(buff), "GO_%s", group_alias); + mir_snprintf(buff, "GO_%s", group_alias); db_set_b(0, szProtoGroups, buff, (BYTE)(group_open ? 1 : 0)); // inverse mapping - mir_snprintf(buff, SIZEOF(buff), "GA_%s", group_name); + mir_snprintf(buff, "GA_%s", group_name); db_set_utf(0, szProtoGroups, buff, group_alias); AddGroup(group_alias, group_open); @@ -223,7 +223,7 @@ void CSametimeProto::ExportContactsToList(mwSametimeList* user_list) group_alias = _strdup(Translate("None")); if (group_alias) { - mir_snprintf(buff, SIZEOF(buff), "GT_%s", group_alias); + mir_snprintf(buff, "GT_%s", group_alias); group_type = (mwSametimeGroupType)db_get_b(0, szProtoGroups, buff, (BYTE)mwSametimeGroup_NORMAL); // apparently we don't want to upload contacts in dynamic groups - see gaim sametime plugin comments if (group_type == mwSametimeGroup_DYNAMIC) { @@ -234,7 +234,7 @@ void CSametimeProto::ExportContactsToList(mwSametimeList* user_list) continue; } - mir_snprintf(buff, SIZEOF(buff), "GN_%s", group_alias); + mir_snprintf(buff, "GN_%s", group_alias); if (!db_get_utf(0, szProtoGroups, buff, &dbv2)) { group_name = _strdup(dbv2.pszVal); db_free(&dbv2); @@ -252,7 +252,7 @@ void CSametimeProto::ExportContactsToList(mwSametimeList* user_list) group_open = (expanded != 0); } else { - mir_snprintf(buff, SIZEOF(buff), "GO_%s", group_alias); + mir_snprintf(buff, "GO_%s", group_alias); group_open = (db_get_b(0, szProtoGroups, buff, 0) == 1); } @@ -505,7 +505,7 @@ void mwAwareList_on_aware(mwAwareList* list, mwAwareSnapshot* aware) mwSametimeList* user_list = mwSametimeList_new(); mwSametimeGroup* stgroup = mwSametimeGroup_new(user_list, mwSametimeGroup_DYNAMIC, aware->group); char buff[256]; - mir_snprintf(buff, SIZEOF(buff), "GA_%s", aware->group); + mir_snprintf(buff, "GA_%s", aware->group); if (!db_get_utf(0, proto->szProtoGroups, buff, &dbv)) { mwSametimeGroup_setAlias(stgroup, dbv.pszVal); db_free(&dbv); diff --git a/protocols/SkypeWeb/src/skype_events.cpp b/protocols/SkypeWeb/src/skype_events.cpp index e848d2920d..8f1339f374 100644 --- a/protocols/SkypeWeb/src/skype_events.cpp +++ b/protocols/SkypeWeb/src/skype_events.cpp @@ -94,8 +94,8 @@ void CSkypeProto::InitPopups() POPUPCLASS ppc = { sizeof(ppc) }; ppc.flags = PCF_TCHAR; - mir_sntprintf(desc, SIZEOF(desc), _T("%s %s"), m_tszUserName, TranslateT("Calls")); - mir_snprintf(name, SIZEOF(name), "%s_%s", m_szModuleName, "Call"); + mir_sntprintf(desc, _T("%s %s"), m_tszUserName, TranslateT("Calls")); + mir_snprintf(name, "%s_%s", m_szModuleName, "Call"); ppc.ptszDescription = desc; ppc.pszName = name; ppc.hIcon = Skin_GetIconByHandle(GetIconHandle("inc_call")); @@ -105,8 +105,8 @@ void CSkypeProto::InitPopups() ppc.PluginWindowProc = PopupDlgProcCall; m_hPopupClassCall = Popup_RegisterClass(&ppc); - mir_sntprintf(desc, SIZEOF(desc), _T("%s %s"), m_tszUserName, TranslateT("Notifications")); - mir_snprintf(name, SIZEOF(name), "%s_%s", m_szModuleName, "Notification"); + mir_sntprintf(desc, _T("%s %s"), m_tszUserName, TranslateT("Notifications")); + mir_snprintf(name, "%s_%s", m_szModuleName, "Notification"); ppc.ptszDescription = desc; ppc.pszName = name; ppc.hIcon = Skin_GetIconByHandle(GetIconHandle("notify")); @@ -115,8 +115,8 @@ void CSkypeProto::InitPopups() ppc.iSeconds = 5; m_hPopupClassNotify = Popup_RegisterClass(&ppc); - mir_sntprintf(desc, SIZEOF(desc), _T("%s %s"), m_tszUserName, TranslateT("Errors")); - mir_snprintf(name, SIZEOF(name), "%s_%s", m_szModuleName, "Error"); + mir_sntprintf(desc, _T("%s %s"), m_tszUserName, TranslateT("Errors")); + mir_snprintf(name, "%s_%s", m_szModuleName, "Error"); ppc.ptszDescription = desc; ppc.pszName = name; ppc.hIcon = Skin_GetIconByHandle(GetIconHandle("error")); diff --git a/protocols/Tlen/src/tlen_iqid.cpp b/protocols/Tlen/src/tlen_iqid.cpp index fc8f9f26ac..a6a7f39bd4 100644 --- a/protocols/Tlen/src/tlen_iqid.cpp +++ b/protocols/Tlen/src/tlen_iqid.cpp @@ -596,7 +596,7 @@ void TlenIqResultInfo(TlenProtocol *proto, XmlNode *iqNode) if (hContact != NULL) { if (item->software == NULL) { char str[128]; - mir_snprintf(str, SIZEOF(str), "Tlen Protocol %s", item->protocolVersion); + mir_snprintf(str, "Tlen Protocol %s", item->protocolVersion); db_set_s(hContact, proto->m_szModuleName, "MirVer", str); } } diff --git a/protocols/Tlen/src/tlen_muc.cpp b/protocols/Tlen/src/tlen_muc.cpp index f440c97f57..2b733f6285 100644 --- a/protocols/Tlen/src/tlen_muc.cpp +++ b/protocols/Tlen/src/tlen_muc.cpp @@ -152,7 +152,7 @@ static int TlenMUCSendPresence(TlenProtocol *proto, const char *roomID, const ch return 1; } if (nick != NULL) { - mir_snprintf(str, SIZEOF(str), "%s/%s", roomID, nick); + mir_snprintf(str, "%s/%s", roomID, nick); } else { strncpy_s(str, roomID, _TRUNCATE); } diff --git a/protocols/Tlen/src/tlen_p2p_old.cpp b/protocols/Tlen/src/tlen_p2p_old.cpp index cb72d33849..a582ef2a43 100644 --- a/protocols/Tlen/src/tlen_p2p_old.cpp +++ b/protocols/Tlen/src/tlen_p2p_old.cpp @@ -159,7 +159,7 @@ void TlenP2PEstablishOutgoingConnection(TLEN_FILE_TRANSFER *ft, BOOL sendAck) TlenP2PPacketSetType(packet, TLEN_FILE_PACKET_CONNECTION_REQUEST); TlenP2PPacketPackDword(packet, 1); TlenP2PPacketPackDword(packet, (DWORD) atoi(ft->iqId)); - size_t srt_len = mir_snprintf(str, SIZEOF(str), "%08X%s%d", atoi(ft->iqId), proto->threadData->username, atoi(ft->iqId)); + size_t srt_len = mir_snprintf(str, "%08X%s%d", atoi(ft->iqId), proto->threadData->username, atoi(ft->iqId)); char *hash = TlenSha1(str, (int)srt_len); TlenP2PPacketPackBuffer(packet, hash, 20); mir_free(hash); @@ -202,12 +202,12 @@ TLEN_FILE_TRANSFER* TlenP2PEstablishIncomingConnection(TlenProtocol *proto, HAND while ((i=TlenListFindNext(proto, list, i)) >= 0) { item = TlenListGetItemPtrFromIndex(proto, i); if (item != NULL) { - mir_snprintf(str, SIZEOF(str), "%d", iqId); + mir_snprintf(str, "%d", iqId); if (!mir_strcmp(item->ft->iqId, str)) { char *hash, *nick; int j; nick = TlenNickFromJID(item->ft->jid); - j = mir_snprintf(str, SIZEOF(str), "%08X%s%d", iqId, nick, iqId); + j = mir_snprintf(str, "%08X%s%d", iqId, nick, iqId); mir_free(nick); hash = TlenSha1(str, j); for (j=0;j<20;j++) { diff --git a/protocols/Tlen/src/tlen_thread.cpp b/protocols/Tlen/src/tlen_thread.cpp index f614b0a323..f6c86885b8 100644 --- a/protocols/Tlen/src/tlen_thread.cpp +++ b/protocols/Tlen/src/tlen_thread.cpp @@ -476,7 +476,7 @@ static void TlenProcessStreamClosing(XmlNode *node, ThreadData *info) Netlib_CloseHandle(info->proto); if (node->name && !mir_strcmp(node->name, "stream:error") && node->text){ char buffer[1024]; - mir_snprintf(buffer, SIZEOF(buffer), "%s\n%s", Translate("Tlen Connection Error"), Translate(node->text)); + mir_snprintf(buffer, "%s\n%s", Translate("Tlen Connection Error"), Translate(node->text)); PUShowMessage(buffer, SM_WARNING); } else if (!mir_strcmp(node->name, "s")){ info->proto->debugLogA("Disconnected server message"); diff --git a/protocols/Tlen/src/tlen_voice.cpp b/protocols/Tlen/src/tlen_voice.cpp index 70bf723c23..a08e906761 100644 --- a/protocols/Tlen/src/tlen_voice.cpp +++ b/protocols/Tlen/src/tlen_voice.cpp @@ -845,7 +845,7 @@ static INT_PTR CALLBACK TlenVoiceDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, else { fv = 0; } - mir_snprintf(str, SIZEOF(str), "%.1f kB/s", fv / 1024); + mir_snprintf(str, "%.1f kB/s", fv / 1024); SetDlgItemTextA(hwndDlg, IDC_BYTESOUT, str); if (proto->playbackControl != NULL) { fv = (float)proto->playbackControl->bytesSum; @@ -854,7 +854,7 @@ static INT_PTR CALLBACK TlenVoiceDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, else { fv = 0; } - mir_snprintf(str, SIZEOF(str), "%.1f kB/s", fv / 1024); + mir_snprintf(str, "%.1f kB/s", fv / 1024); SetDlgItemTextA(hwndDlg, IDC_BYTESIN, str); } break; diff --git a/protocols/Tox/src/tox_multimedia.cpp b/protocols/Tox/src/tox_multimedia.cpp index 2068b64a44..ff55177d1a 100644 --- a/protocols/Tox/src/tox_multimedia.cpp +++ b/protocols/Tox/src/tox_multimedia.cpp @@ -321,7 +321,7 @@ INT_PTR CToxProto::OnRecvAudioCall(WPARAM hContact, LPARAM lParam) cle.ptszTooltip = szTooltip; char szService[MAX_PATH]; - mir_snprintf(szService, SIZEOF(szService), "%s/Audio/Ring", GetContactProto(hContact)); + mir_snprintf(szService, "%s/Audio/Ring", GetContactProto(hContact)); cle.pszService = szService; CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle); diff --git a/protocols/Tox/src/tox_network.cpp b/protocols/Tox/src/tox_network.cpp index 860f5c5798..26958fbeef 100644 --- a/protocols/Tox/src/tox_network.cpp +++ b/protocols/Tox/src/tox_network.cpp @@ -27,16 +27,16 @@ void CToxProto::BootstrapNodesFromDb(bool isIPv6) char setting[MAX_PATH]; for (int i = 0; i < nodeCount; i++) { - mir_snprintf(setting, SIZEOF(setting), TOX_SETTINGS_NODE_IPV4, i); + mir_snprintf(setting, TOX_SETTINGS_NODE_IPV4, i); ptrA address(db_get_sa(NULL, module, setting)); - mir_snprintf(setting, SIZEOF(setting), TOX_SETTINGS_NODE_PORT, i); + mir_snprintf(setting, TOX_SETTINGS_NODE_PORT, i); int port = db_get_w(NULL, module, setting, 33445); - mir_snprintf(setting, SIZEOF(setting), TOX_SETTINGS_NODE_PKEY, i); + mir_snprintf(setting, TOX_SETTINGS_NODE_PKEY, i); ptrA pubKey(db_get_sa(NULL, module, setting)); BootstrapNode(address, port, pubKey); if (isIPv6) { - mir_snprintf(setting, SIZEOF(setting), TOX_SETTINGS_NODE_IPV6, i); + mir_snprintf(setting, TOX_SETTINGS_NODE_IPV6, i); address = db_get_sa(NULL, module, setting); BootstrapNode(address, port, pubKey); } diff --git a/protocols/Tox/src/tox_options.cpp b/protocols/Tox/src/tox_options.cpp index 0023c60141..1e5d270231 100644 --- a/protocols/Tox/src/tox_options.cpp +++ b/protocols/Tox/src/tox_options.cpp @@ -428,15 +428,15 @@ void CToxOptionsNodeList::OnInitDialog() int nodeCount = db_get_w(NULL, module, TOX_SETTINGS_NODE_COUNT, 0); for (int i = 0; i < nodeCount; i++) { - mir_snprintf(setting, SIZEOF(setting), TOX_SETTINGS_NODE_IPV4, i); + mir_snprintf(setting, TOX_SETTINGS_NODE_IPV4, i); ptrT value(db_get_tsa(NULL, module, setting)); iItem = m_nodes.AddItem(value, -1, NULL, 1); - mir_snprintf(setting, SIZEOF(setting), TOX_SETTINGS_NODE_IPV6, i); + mir_snprintf(setting, TOX_SETTINGS_NODE_IPV6, i); value = db_get_tsa(NULL, module, setting); m_nodes.SetItem(iItem, 1, value); - mir_snprintf(setting, SIZEOF(setting), TOX_SETTINGS_NODE_PORT, i); + mir_snprintf(setting, TOX_SETTINGS_NODE_PORT, i); int port = db_get_w(NULL, module, setting, 0); if (port > 0) { @@ -445,7 +445,7 @@ void CToxOptionsNodeList::OnInitDialog() m_nodes.SetItem(iItem, 2, mir_a2t(portNum)); } - mir_snprintf(setting, SIZEOF(setting), TOX_SETTINGS_NODE_PKEY, i); + mir_snprintf(setting, TOX_SETTINGS_NODE_PKEY, i); value = db_get_tsa(NULL, module, setting); m_nodes.SetItem(iItem, 3, value); @@ -547,22 +547,22 @@ void CToxOptionsNodeList::OnApply() lvi.mask = LVIF_TEXT; lvi.iSubItem = 0; m_nodes.GetItem(&lvi); - mir_snprintf(setting, SIZEOF(setting), TOX_SETTINGS_NODE_IPV4, iItem); + mir_snprintf(setting, TOX_SETTINGS_NODE_IPV4, iItem); db_set_s(NULL, module, setting, _T2A(lvi.pszText)); lvi.iSubItem = 1; m_nodes.GetItem(&lvi); - mir_snprintf(setting, SIZEOF(setting), TOX_SETTINGS_NODE_IPV6, iItem); + mir_snprintf(setting, TOX_SETTINGS_NODE_IPV6, iItem); db_set_s(NULL, module, setting, _T2A(lvi.pszText)); lvi.iSubItem = 2; m_nodes.GetItem(&lvi); - mir_snprintf(setting, SIZEOF(setting), TOX_SETTINGS_NODE_PORT, iItem); + mir_snprintf(setting, TOX_SETTINGS_NODE_PORT, iItem); db_set_w(NULL, module, setting, _ttoi(lvi.pszText)); lvi.iSubItem = 3; m_nodes.GetItem(&lvi); - mir_snprintf(setting, SIZEOF(setting), TOX_SETTINGS_NODE_PKEY, iItem); + mir_snprintf(setting, TOX_SETTINGS_NODE_PKEY, iItem); db_set_s(NULL, module, setting, _T2A(lvi.pszText)); iItem++; @@ -571,13 +571,13 @@ void CToxOptionsNodeList::OnApply() int nodeCount = db_get_b(NULL, module, TOX_SETTINGS_NODE_COUNT, 0); for (iItem = itemCount; iItem < nodeCount; iItem++) { - mir_snprintf(setting, SIZEOF(setting), TOX_SETTINGS_NODE_IPV4, iItem); + mir_snprintf(setting, TOX_SETTINGS_NODE_IPV4, iItem); db_unset(NULL, module, setting); - mir_snprintf(setting, SIZEOF(setting), TOX_SETTINGS_NODE_IPV6, iItem); + mir_snprintf(setting, TOX_SETTINGS_NODE_IPV6, iItem); db_unset(NULL, module, setting); - mir_snprintf(setting, SIZEOF(setting), TOX_SETTINGS_NODE_PORT, iItem); + mir_snprintf(setting, TOX_SETTINGS_NODE_PORT, iItem); db_unset(NULL, module, setting); - mir_snprintf(setting, SIZEOF(setting), TOX_SETTINGS_NODE_PKEY, iItem); + mir_snprintf(setting, TOX_SETTINGS_NODE_PKEY, iItem); db_unset(NULL, module, setting); } db_set_b(NULL, module, TOX_SETTINGS_NODE_COUNT, itemCount); diff --git a/protocols/Twitter/src/ui.cpp b/protocols/Twitter/src/ui.cpp index a0232d5da2..c1575bd090 100644 --- a/protocols/Twitter/src/ui.cpp +++ b/protocols/Twitter/src/ui.cpp @@ -138,7 +138,7 @@ INT_PTR CALLBACK tweet_proc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam else if (LOWORD(wParam) == IDC_TWEETMSG && HIWORD(wParam) == EN_CHANGE) { size_t len = SendDlgItemMessage(hwndDlg, IDC_TWEETMSG, WM_GETTEXTLENGTH, 0, 0); char str[16]; - mir_snprintf(str, SIZEOF(str), "%d", 140 - len); + mir_snprintf(str, "%d", 140 - len); SetDlgItemTextA(hwndDlg, IDC_CHARACTERS, str); return true; @@ -154,7 +154,7 @@ INT_PTR CALLBACK tweet_proc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam SendDlgItemMessage(hwndDlg, IDC_TWEETMSG, EM_SETSEL, len, len); char str[16]; - mir_snprintf(str, SIZEOF(str), "%d", 140 - len); + mir_snprintf(str, "%d", 140 - len); SetDlgItemTextA(hwndDlg, IDC_CHARACTERS, str); return true; @@ -393,7 +393,7 @@ INT_PTR CALLBACK popup_options_proc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA CheckAndUpdateDlgButton(hwndDlg, IDC_TIMEOUT_PERMANENT, true); else { char str[32]; - mir_snprintf(str, SIZEOF(str), "%d", timeout); + mir_snprintf(str, "%d", timeout); SetDlgItemTextA(hwndDlg, IDC_TIMEOUT, str); CheckAndUpdateDlgButton(hwndDlg, IDC_TIMEOUT_CUSTOM, true); } diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp index 887cafdf8c..28f0e88289 100644 --- a/protocols/VKontakte/src/vk_proto.cpp +++ b/protocols/VKontakte/src/vk_proto.cpp @@ -198,35 +198,35 @@ void CVkProto::InitMenus() mi.flags = CMIF_CHILDPOPUP; mi.hParentMenu = MO_GetProtoRootMenu(m_szModuleName); - mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_CREATECHAT); + mir_snprintf(szService, "%s%s", m_szModuleName, PS_CREATECHAT); mi.pszService = szService; mi.position = 10009 + PMI_CREATECHAT; mi.icolibItem = LoadSkinnedIconHandle(SKINICON_CHAT_JOIN); mi.pszName = LPGEN("Create new chat"); g_hProtoMenuItems[PMI_CREATECHAT] = Menu_AddProtoMenuItem(&mi); - mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_SETSTATUSMSG); + mir_snprintf(szService, "%s%s", m_szModuleName, PS_SETSTATUSMSG); mi.pszService = szService; mi.position = 10009 + PMI_SETSTATUSMSG; mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_STATUS)); mi.pszName = LPGEN("Status message"); g_hProtoMenuItems[PMI_SETSTATUSMSG] = Menu_AddProtoMenuItem(&mi); - mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_WALLPOST); + mir_snprintf(szService, "%s%s", m_szModuleName, PS_WALLPOST); mi.pszService = szService; mi.position = 10009 + PMI_WALLPOST; mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_WALL)); mi.pszName = LPGEN("Send message to my wall"); g_hProtoMenuItems[PMI_WALLPOST] = Menu_AddProtoMenuItem(&mi); - mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_LOADVKNEWS); + mir_snprintf(szService, "%s%s", m_szModuleName, PS_LOADVKNEWS); mi.pszService = szService; mi.position = 10009 + PMI_LOADVKNEWS; mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_NOTIFICATION)); mi.pszName = LPGEN("Load news from VK"); g_hProtoMenuItems[PMI_LOADVKNEWS] = Menu_AddProtoMenuItem(&mi); - mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_VISITPROFILE); + mir_snprintf(szService, "%s%s", m_szModuleName, PS_VISITPROFILE); mi.pszService = szService; mi.position = 10009 + PMI_VISITPROFILE; mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_VISITPROFILE)); @@ -241,56 +241,56 @@ void CVkProto::InitMenus() mi.ptszName = LPGENT("Visit profile"); g_hContactMenuItems[CMI_VISITPROFILE] = Menu_AddContactMenuItem(&mi); - mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_WALLPOST); + mir_snprintf(szService, "%s%s", m_szModuleName, PS_WALLPOST); mi.position = -200001000 + CMI_WALLPOST; mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_WALL)); mi.ptszName = LPGENT("Send message to user\'s wall"); mi.pszService = szService; g_hContactMenuItems[CMI_WALLPOST] = Menu_AddContactMenuItem(&mi); - mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_ADDASFRIEND); + mir_snprintf(szService, "%s%s", m_szModuleName, PS_ADDASFRIEND); mi.position = -200001000 + CMI_ADDASFRIEND; mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_FRIENDADD)); mi.ptszName = LPGENT("Add as friend"); mi.pszService = szService; g_hContactMenuItems[CMI_ADDASFRIEND] = Menu_AddContactMenuItem(&mi); - mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_DELETEFRIEND); + mir_snprintf(szService, "%s%s", m_szModuleName, PS_DELETEFRIEND); mi.position = -200001000 + CMI_DELETEFRIEND; mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_FRIENDDEL)); mi.ptszName = LPGENT("Delete from friend list"); mi.pszService = szService; g_hContactMenuItems[CMI_DELETEFRIEND] = Menu_AddContactMenuItem(&mi); - mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_BANUSER); + mir_snprintf(szService, "%s%s", m_szModuleName, PS_BANUSER); mi.position = -200001000 + CMI_BANUSER; mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_BAN)); mi.ptszName = LPGENT("Ban user"); mi.pszService = szService; g_hContactMenuItems[CMI_BANUSER] = Menu_AddContactMenuItem(&mi); - mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_REPORTABUSE); + mir_snprintf(szService, "%s%s", m_szModuleName, PS_REPORTABUSE); mi.position = -200001000 + CMI_REPORTABUSE; mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_ABUSE)); mi.ptszName = LPGENT("Report abuse"); mi.pszService = szService; g_hContactMenuItems[CMI_REPORTABUSE] = Menu_AddContactMenuItem(&mi); - mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_DESTROYKICKCHAT); + mir_snprintf(szService, "%s%s", m_szModuleName, PS_DESTROYKICKCHAT); mi.position = -200001000 + CMI_DESTROYKICKCHAT; mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_FRIENDDEL)); mi.ptszName = LPGENT("Destroy room"); mi.pszService = szService; g_hContactMenuItems[CMI_DESTROYKICKCHAT] = Menu_AddContactMenuItem(&mi); - mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_OPENBROADCAST); + mir_snprintf(szService, "%s%s", m_szModuleName, PS_OPENBROADCAST); mi.position = -200001000 + CMI_OPENBROADCAST; mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_BROADCAST)); mi.ptszName = LPGENT("Open broadcast"); mi.pszService = szService; g_hContactMenuItems[CMI_OPENBROADCAST] = Menu_AddContactMenuItem(&mi); - mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_LOADVKNEWS); + mir_snprintf(szService, "%s%s", m_szModuleName, PS_LOADVKNEWS); mi.pszService = szService; mi.position = -200001000 + CMI_LOADVKNEWS; mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_NOTIFICATION)); @@ -298,7 +298,7 @@ void CVkProto::InitMenus() g_hContactMenuItems[CMI_LOADVKNEWS] = Menu_AddContactMenuItem(&mi); // Sync history menu - mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_GETSERVERHISTORY); + mir_snprintf(szService, "%s%s", m_szModuleName, PS_GETSERVERHISTORY); mi.position = -200001000 + CMI_GETSERVERHISTORY; mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_HISTORY)); mi.ptszName = LPGENT("Reload messages from vk.com..."); @@ -308,42 +308,42 @@ void CVkProto::InitMenus() mi.flags |= CMIF_CHILDPOPUP; mi.hParentMenu = g_hContactMenuItems[CMI_GETSERVERHISTORY]; - mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_GETSERVERHISTORYLAST1DAY); + mir_snprintf(szService, "%s%s", m_szModuleName, PS_GETSERVERHISTORYLAST1DAY); mi.position = -200001000 + CMI_GETSERVERHISTORY + 100 + CHMI_GETSERVERHISTORYLAST1DAY; mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_HISTORY)); mi.ptszName = LPGENT("for last 1 day"); mi.pszService = szService; g_hContactHistoryMenuItems[CHMI_GETSERVERHISTORYLAST1DAY] = Menu_AddContactMenuItem(&mi); - mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_GETSERVERHISTORYLAST3DAY); + mir_snprintf(szService, "%s%s", m_szModuleName, PS_GETSERVERHISTORYLAST3DAY); mi.position = -200001000 + CMI_GETSERVERHISTORY + 100 + CHMI_GETSERVERHISTORYLAST3DAY; mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_HISTORY)); mi.ptszName = LPGENT("for last 3 days"); mi.pszService = szService; g_hContactHistoryMenuItems[CHMI_GETSERVERHISTORYLAST3DAY] = Menu_AddContactMenuItem(&mi); - mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_GETSERVERHISTORYLAST7DAY); + mir_snprintf(szService, "%s%s", m_szModuleName, PS_GETSERVERHISTORYLAST7DAY); mi.position = -200001000 + CMI_GETSERVERHISTORY + 100 + CHMI_GETSERVERHISTORYLAST7DAY; mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_HISTORY)); mi.ptszName = LPGENT("for last week"); mi.pszService = szService; g_hContactHistoryMenuItems[CHMI_GETSERVERHISTORYLAST7DAY] = Menu_AddContactMenuItem(&mi); - mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_GETSERVERHISTORYLAST30DAY); + mir_snprintf(szService, "%s%s", m_szModuleName, PS_GETSERVERHISTORYLAST30DAY); mi.position = -200001000 + CMI_GETSERVERHISTORY + 100 + CHMI_GETSERVERHISTORYLAST30DAY; mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_HISTORY)); mi.ptszName = LPGENT("for last 30 days"); mi.pszService = szService; g_hContactHistoryMenuItems[CHMI_GETSERVERHISTORYLAST30DAY] = Menu_AddContactMenuItem(&mi); - mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_GETSERVERHISTORYLAST90DAY); + mir_snprintf(szService, "%s%s", m_szModuleName, PS_GETSERVERHISTORYLAST90DAY); mi.position = -200001000 + CMI_GETSERVERHISTORY + 100 + CHMI_GETSERVERHISTORYLAST90DAY; mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_HISTORY)); mi.ptszName = LPGENT("for last 90 days"); mi.pszService = szService; g_hContactHistoryMenuItems[CHMI_GETSERVERHISTORYLAST90DAY] = Menu_AddContactMenuItem(&mi); - mir_snprintf(szService, SIZEOF(szService), "%s%s", m_szModuleName, PS_GETALLSERVERHISTORY); + mir_snprintf(szService, "%s%s", m_szModuleName, PS_GETALLSERVERHISTORY); mi.position = -200001000 + CMI_GETSERVERHISTORY + 100 + CHMI_GETALLSERVERHISTORY; mi.icolibItem = Skin_GetIconByHandle(GetIconHandle(IDI_HISTORY)); mi.ptszName = LPGENT("for all time"); @@ -394,8 +394,8 @@ void CVkProto::InitPopups(void) POPUPCLASS ppc = { sizeof(ppc) }; ppc.flags = PCF_TCHAR; - mir_sntprintf(desc, SIZEOF(desc), _T("%s %s"), m_tszUserName, TranslateT("Errors")); - mir_snprintf(name, SIZEOF(name), "%s_%s", m_szModuleName, "Error"); + mir_sntprintf(desc, _T("%s %s"), m_tszUserName, TranslateT("Errors")); + mir_snprintf(name, "%s_%s", m_szModuleName, "Error"); ppc.ptszDescription = desc; ppc.pszName = name; ppc.hIcon = LoadSkinnedIcon(SKINICON_ERROR); @@ -404,8 +404,8 @@ void CVkProto::InitPopups(void) ppc.iSeconds = 60; m_hPopupClassError = Popup_RegisterClass(&ppc); - mir_sntprintf(desc, SIZEOF(desc), _T("%s %s"), m_tszUserName, TranslateT("Notification")); - mir_snprintf(name, SIZEOF(name), "%s_%s", m_szModuleName, "Notification"); + mir_sntprintf(desc, _T("%s %s"), m_tszUserName, TranslateT("Notification")); + mir_snprintf(name, "%s_%s", m_szModuleName, "Notification"); ppc.ptszDescription = desc; ppc.pszName = name; ppc.hIcon = Skin_GetIconByHandle(GetIconHandle(IDI_NOTIFICATION)); @@ -425,7 +425,7 @@ void CVkProto::MsgPopup(MCONTACT hContact, const TCHAR *szMsg, const TCHAR *szTi ppd.ptszText = szMsg; ppd.pszClassName = name; ppd.hContact = hContact; - mir_snprintf(name, SIZEOF(name), "%s_%s", m_szModuleName, err ? "Error" : "Notification"); + mir_snprintf(name, "%s_%s", m_szModuleName, err ? "Error" : "Notification"); CallService(MS_POPUP_ADDPOPUPCLASS, 0, (LPARAM)&ppd); } diff --git a/protocols/Xfire/src/SHA1.cpp b/protocols/Xfire/src/SHA1.cpp index 49ac7ab1aa..a310dc5dd6 100644 --- a/protocols/Xfire/src/SHA1.cpp +++ b/protocols/Xfire/src/SHA1.cpp @@ -229,23 +229,23 @@ void CSHA1::ReportHash(char *szReport, unsigned char uReportType) if (uReportType == REPORT_HEX) { - mir_snprintf(szTemp, SIZEOF(szTemp), "%02X", m_digest[0]); + mir_snprintf(szTemp, "%02X", m_digest[0]); mir_strcat(szReport, szTemp); for(i = 1; i < 20; i++) { - mir_snprintf(szTemp, SIZEOF(szTemp), " %02X", m_digest[i]); + mir_snprintf(szTemp, " %02X", m_digest[i]); mir_strcat(szReport, szTemp); } } else if (uReportType == REPORT_DIGIT) { - mir_snprintf(szTemp, SIZEOF(szTemp), "%u", m_digest[0]); + mir_snprintf(szTemp, "%u", m_digest[0]); mir_strcat(szReport, szTemp); for(i = 1; i < 20; i++) { - mir_snprintf(szTemp, SIZEOF(szTemp), " %u", m_digest[i]); + mir_snprintf(szTemp, " %u", m_digest[i]); mir_strcat(szReport, szTemp); } } diff --git a/protocols/Xfire/src/clientloginpacket.cpp b/protocols/Xfire/src/clientloginpacket.cpp index 75ccf09e2d..59ac46fcdd 100644 --- a/protocols/Xfire/src/clientloginpacket.cpp +++ b/protocols/Xfire/src/clientloginpacket.cpp @@ -26,7 +26,7 @@ #include "SHA1.h" #include #include -#include "baseProtocol.h" +#include "baseProtocol.h" namespace xfirelib { using namespace std; @@ -112,7 +112,7 @@ void ClientLoginPacket::hashSha1(const char *string, unsigned char *sha){ result[0] = 0; char szTemp[16]; for(int i = 0 ; i < 20 ; i++) { - mir_snprintf(szTemp, SIZEOF(szTemp), "%02x", temp[i]); + mir_snprintf(szTemp, "%02x", temp[i]); mir_strcat(result,szTemp); } memcpy(sha,result,40); diff --git a/protocols/Xfire/src/tools.cpp b/protocols/Xfire/src/tools.cpp index 05658e1ac8..ad982108b6 100644 --- a/protocols/Xfire/src/tools.cpp +++ b/protocols/Xfire/src/tools.cpp @@ -42,9 +42,9 @@ extern HANDLE hNetlib; for(int i=0;i> 24) & 0xFF, (pluginInfo.version >> 16) & 0xFF, + mir_snprintf(str, "Yahoo v%d.%d.%d.%d", (pluginInfo.version >> 24) & 0xFF, (pluginInfo.version >> 16) & 0xFF, (pluginInfo.version >> 8) & 0xFF, pluginInfo.version & 0xFF); debugLogA(str); } diff --git a/protocols/Yahoo/src/yahoo.h b/protocols/Yahoo/src/yahoo.h index 758918768f..97c38e77ae 100644 --- a/protocols/Yahoo/src/yahoo.h +++ b/protocols/Yahoo/src/yahoo.h @@ -30,11 +30,8 @@ #include "libyahoo2/yahoo2_callbacks.h" #include "libyahoo2/yahoo_util.h" -extern "C" -{ - #include - #include -}; +#include +#include #include #include -- cgit v1.2.3