diff options
Diffstat (limited to 'protocols')
156 files changed, 689 insertions, 693 deletions
diff --git a/protocols/AimOscar/src/client.cpp b/protocols/AimOscar/src/client.cpp index b99ca2e133..1718f23ef5 100644 --- a/protocols/AimOscar/src/client.cpp +++ b/protocols/AimOscar/src/client.cpp @@ -54,7 +54,7 @@ int CAimProto::aim_auth_request(HANDLE hServerConn, unsigned short &seqno, const char client_id[64], mirver[64];
CallService(MS_SYSTEM_GETVERSIONTEXT, sizeof(mirver), (LPARAM)mirver);
- int client_id_len = mir_snprintf(client_id, _countof(client_id), "Miranda AIM, version %s", mirver);
+ int client_id_len = mir_snprintf(client_id, "Miranda AIM, version %s", mirver);
char* buf = (char*)alloca(SNAC_SIZE + TLV_HEADER_SIZE * 14 + MD5_HASH_LENGTH + mir_strlen(username) + client_id_len + 30 + mir_strlen(language) + mir_strlen(country));
diff --git a/protocols/AimOscar/src/file.cpp b/protocols/AimOscar/src/file.cpp index 33bcbf0afe..aaf531eb22 100644 --- a/protocols/AimOscar/src/file.cpp +++ b/protocols/AimOscar/src/file.cpp @@ -97,7 +97,7 @@ void CAimProto::report_file_error(TCHAR *fname) {
TCHAR errmsg[512];
TCHAR* error = mir_a2t(_strerror(NULL));
- mir_sntprintf(errmsg, _countof(errmsg), TranslateT("Failed to open file: %s : %s"), fname, error);
+ mir_sntprintf(errmsg, TranslateT("Failed to open file: %s : %s"), fname, error);
mir_free(error);
ShowPopup((char*)errmsg, ERROR_POPUP | TCHAR_POPUP);
}
@@ -324,7 +324,7 @@ int CAimProto::receiving_file(file_transfer *ft, HANDLE hServerPacketRecver, NET mir_free(buf);
TCHAR fname[256];
- mir_sntprintf(fname, _countof(fname), _T("%s%s"), ft->pfts.tszWorkingDir, name);
+ mir_sntprintf(fname, _T("%s%s"), ft->pfts.tszWorkingDir, name);
mir_free(name);
mir_free(ft->pfts.tszCurrentFile);
ft->pfts.tszCurrentFile = mir_tstrdup(fname);
diff --git a/protocols/AimOscar/src/popup.cpp b/protocols/AimOscar/src/popup.cpp index 01eec9d9b2..13d1888690 100644 --- a/protocols/AimOscar/src/popup.cpp +++ b/protocols/AimOscar/src/popup.cpp @@ -65,7 +65,7 @@ void CAimProto::ShowPopup(const char* msg, int flags, char* url) {
POPUPDATAT ppd = {0};
- mir_sntprintf(ppd.lptzContactName, _countof(ppd.lptzContactName), TranslateT("%s Protocol"), m_tszUserName);
+ mir_sntprintf(ppd.lptzContactName, TranslateT("%s Protocol"), m_tszUserName);
if (flags & ERROR_POPUP)
{
diff --git a/protocols/AimOscar/src/proto.cpp b/protocols/AimOscar/src/proto.cpp index 276706acc7..2d359ac09e 100644 --- a/protocols/AimOscar/src/proto.cpp +++ b/protocols/AimOscar/src/proto.cpp @@ -57,7 +57,7 @@ CAimProto::CAimProto(const char* aProtoName, const TCHAR* aUserName) : m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
char szP2P[128];
- mir_snprintf(szP2P, _countof(szP2P), "%sP2P", m_szModuleName);
+ mir_snprintf(szP2P, "%sP2P", m_szModuleName);
nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_TCHAR;
mir_sntprintf(descr, TranslateT("%s Client-to-client connection"), m_tszUserName);
nlu.szSettingsModule = szP2P;
@@ -672,7 +672,7 @@ int __cdecl CAimProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM l case EV_PROTO_ONERASE:
char szDbsettings[64];
- mir_snprintf(szDbsettings, _countof(szDbsettings), "%sP2P", m_szModuleName);
+ mir_snprintf(szDbsettings, "%sP2P", m_szModuleName);
CallService(MS_DB_MODULE_DELETE, 0, (LPARAM)szDbsettings);
break;
diff --git a/protocols/AimOscar/src/server.cpp b/protocols/AimOscar/src/server.cpp index a69a768d25..c780fb5129 100644 --- a/protocols/AimOscar/src/server.cpp +++ b/protocols/AimOscar/src/server.cpp @@ -289,7 +289,7 @@ void CAimProto::snac_user_online(SNAC &snac)//family 0x0003 char f = cap[13];
char g = cap[14];
char h = cap[15];
- mir_snprintf(client, _countof(client), CLIENT_OSCARJ, a & 0x7f, b, c, d, alpha_cap_str(a), e & 0x7f, f, g, h, alpha_cap_str(e));
+ mir_snprintf(client, CLIENT_OSCARJ, a & 0x7f, b, c, d, alpha_cap_str(a), e & 0x7f, f, g, h, alpha_cap_str(e));
}
else if (memcmp(cap, "MirandaA", 8) == 0) {
char a = cap[8];
@@ -300,7 +300,7 @@ void CAimProto::snac_user_online(SNAC &snac)//family 0x0003 char f = cap[13];
char g = cap[14];
char h = cap[15];
- mir_snprintf(client, _countof(client), CLIENT_AIMOSCAR, a, b, c, d, e, f, g, h);
+ mir_snprintf(client, CLIENT_AIMOSCAR, a, b, c, d, e, f, g, h);
}
if (memcmp(cap, "sinj", 4) == 0) {
char a = cap[4];
@@ -311,7 +311,7 @@ void CAimProto::snac_user_online(SNAC &snac)//family 0x0003 char f = cap[9];
char g = cap[10];
char h = cap[11];
- mir_snprintf(client, _countof(client), CLIENT_OSCARSN, a & 0x7f, b, c, d, alpha_cap_str(a), e & 0x7f, f, g, h, alpha_cap_str(e), secure_cap_str(&cap[12]));
+ mir_snprintf(client, CLIENT_OSCARSN, a & 0x7f, b, c, d, alpha_cap_str(a), e & 0x7f, f, g, h, alpha_cap_str(e), secure_cap_str(&cap[12]));
}
if (memcmp(cap, "icqp", 4) == 0) {
char a = cap[4];
@@ -322,7 +322,7 @@ void CAimProto::snac_user_online(SNAC &snac)//family 0x0003 char f = cap[9];
char g = cap[10];
char h = cap[11];
- mir_snprintf(client, _countof(client), CLIENT_OSCARPL, a & 0x7f, b, c, d, alpha_cap_str(a), e & 0x7f, f, g, h, alpha_cap_str(e), secure_cap_str(&cap[12]));
+ mir_snprintf(client, CLIENT_OSCARPL, a & 0x7f, b, c, d, alpha_cap_str(a), e & 0x7f, f, g, h, alpha_cap_str(e), secure_cap_str(&cap[12]));
}
else if (memcmp(cap, "Kopete ICQ", 10) == 0) {
mir_strcpy(client, CLIENT_KOPETE);
@@ -1469,7 +1469,7 @@ void CAimProto::snac_list_modification_ack(SNAC &snac)//family 0x0013 default:
char msg[64];
- mir_snprintf(msg, _countof(msg), "Error removing buddy from list. Error code %#x", code);
+ mir_snprintf(msg, "Error removing buddy from list. Error code %#x", code);
ShowPopup(msg, ERROR_POPUP);
break;
}
@@ -1503,7 +1503,7 @@ void CAimProto::snac_list_modification_ack(SNAC &snac)//family 0x0013 default:
char msg[64];
- mir_snprintf(msg, _countof(msg), Translate("Unknown error when adding buddy to list. Error code %#x"), code);
+ mir_snprintf(msg, Translate("Unknown error when adding buddy to list. Error code %#x"), code);
ShowPopup(msg, ERROR_POPUP);
break;
}
@@ -1521,7 +1521,7 @@ void CAimProto::snac_list_modification_ack(SNAC &snac)//family 0x0013 default:
char msg[64];
- mir_snprintf(msg, _countof(msg), Translate("Unknown error when attempting to modify a group. Error code %#x"), code);
+ mir_snprintf(msg, Translate("Unknown error when attempting to modify a group. Error code %#x"), code);
ShowPopup(msg, ERROR_POPUP);
break;
}
@@ -1661,7 +1661,7 @@ void CAimProto::snac_mail_response(SNAC &snac)//family 0x0018 if (new_mail && num_msgs) {
TCHAR msg[1024];
- int len = mir_sntprintf(msg, _countof(msg), _T("%S@%S (%d)\r\n%s "), sn, address, num_msgs,
+ int len = mir_sntprintf(msg, _T("%S@%S (%d)\r\n%s "), sn, address, num_msgs,
TranslateT("You've got mail! Checked at"));
SYSTEMTIME stLocal;
diff --git a/protocols/AimOscar/src/services.cpp b/protocols/AimOscar/src/services.cpp index 27fe595f9a..a4e6b7050f 100644 --- a/protocols/AimOscar/src/services.cpp +++ b/protocols/AimOscar/src/services.cpp @@ -467,7 +467,7 @@ INT_PTR CAimProto::SetAvatar(WPARAM, LPARAM lParam) int fileId = _topen(tFileName, _O_CREAT | _O_TRUNC | _O_WRONLY | O_BINARY, _S_IREAD | _S_IWRITE);
if (fileId < 0) {
char errmsg[512];
- mir_snprintf(errmsg, _countof(errmsg), "Cannot store avatar. File '%s' could not be created/overwritten", tFileName);
+ mir_snprintf(errmsg, "Cannot store avatar. File '%s' could not be created/overwritten", tFileName);
ShowPopup(errmsg, ERROR_POPUP);
return 1;
}
diff --git a/protocols/AimOscar/src/theme.cpp b/protocols/AimOscar/src/theme.cpp index 200c6f90cf..374f517d9c 100644 --- a/protocols/AimOscar/src/theme.cpp +++ b/protocols/AimOscar/src/theme.cpp @@ -63,7 +63,7 @@ void InitIcons(void) HICON LoadIconEx(const char *name, bool big)
{
char szSettingName[100];
- mir_snprintf(szSettingName, _countof(szSettingName), "AIM_%s", name);
+ mir_snprintf(szSettingName, "AIM_%s", name);
return IcoLib_GetIcon(szSettingName, big);
}
@@ -79,7 +79,7 @@ HANDLE GetIconHandle(const char *name) void ReleaseIconEx(const char *name, bool big)
{
char szSettingName[100];
- mir_snprintf(szSettingName, _countof(szSettingName ), "%s_%s", "AIM", name);
+ mir_snprintf(szSettingName, "%s_%s", "AIM", name);
IcoLib_Release(szSettingName, big);
}
diff --git a/protocols/AimOscar/src/utility.cpp b/protocols/AimOscar/src/utility.cpp index 0a774fbf5b..0c785deb79 100644 --- a/protocols/AimOscar/src/utility.cpp +++ b/protocols/AimOscar/src/utility.cpp @@ -474,42 +474,42 @@ void BdList::remove_by_id(unsigned short id) unsigned short CAimProto::getBuddyId(MCONTACT hContact, int i)
{
char item[sizeof(AIM_KEY_BI) + 10];
- mir_snprintf(item, _countof(item), AIM_KEY_BI"%d", i);
+ mir_snprintf(item, AIM_KEY_BI"%d", i);
return getWord(hContact, item, 0);
}
void CAimProto::setBuddyId(MCONTACT hContact, int i, unsigned short id)
{
char item[sizeof(AIM_KEY_BI) + 10];
- mir_snprintf(item, _countof(item), AIM_KEY_BI"%d", i);
+ mir_snprintf(item, AIM_KEY_BI"%d", i);
setWord(hContact, item, id);
}
int CAimProto::deleteBuddyId(MCONTACT hContact, int i)
{
char item[sizeof(AIM_KEY_BI) + 10];
- mir_snprintf(item, _countof(item), AIM_KEY_BI"%d", i);
+ mir_snprintf(item, AIM_KEY_BI"%d", i);
return delSetting(hContact, item);
}
unsigned short CAimProto::getGroupId(MCONTACT hContact, int i)
{
char item[sizeof(AIM_KEY_GI) + 10];
- mir_snprintf(item, _countof(item), AIM_KEY_GI"%d", i);
+ mir_snprintf(item, AIM_KEY_GI"%d", i);
return getWord(hContact, item, 0);
}
void CAimProto::setGroupId(MCONTACT hContact, int i, unsigned short id)
{
char item[sizeof(AIM_KEY_GI) + 10];
- mir_snprintf(item, _countof(item), AIM_KEY_GI"%d", i);
+ mir_snprintf(item, AIM_KEY_GI"%d", i);
setWord(hContact, item, id);
}
int CAimProto::deleteGroupId(MCONTACT hContact, int i)
{
char item[sizeof(AIM_KEY_GI) + 10];
- mir_snprintf(item, _countof(item), AIM_KEY_GI"%d", i);
+ mir_snprintf(item, AIM_KEY_GI"%d", i);
return delSetting(hContact, item);
}
@@ -530,7 +530,7 @@ int CAimProto::open_contact_file(const char*, const TCHAR* file, const char*, TC int fid = _topen(path, _O_CREAT | _O_RDWR | _O_BINARY, _S_IREAD);
if (fid < 0) {
TCHAR errmsg[512];
- mir_sntprintf(errmsg, _countof(errmsg), TranslateT("Failed to open file: %s %s"), path, __tcserror(NULL));
+ mir_sntprintf(errmsg, TranslateT("Failed to open file: %s %s"), path, __tcserror(NULL));
ShowPopup((char*)errmsg, ERROR_POPUP | TCHAR_POPUP);
}
return fid;
diff --git a/protocols/FacebookRM/src/avatars.cpp b/protocols/FacebookRM/src/avatars.cpp index 047f9a29d2..f78db6f0a1 100644 --- a/protocols/FacebookRM/src/avatars.cpp +++ b/protocols/FacebookRM/src/avatars.cpp @@ -126,7 +126,7 @@ void FacebookProto::UpdateAvatarWorker(void *) std::tstring FacebookProto::GetAvatarFolder()
{
TCHAR path[MAX_PATH];
- mir_sntprintf(path, _countof(path), _T("%s\\%s"), VARST(_T("%miranda_avatarcache%")), m_tszUserName);
+ mir_sntprintf(path, _T("%s\\%s"), VARST(_T("%miranda_avatarcache%")), m_tszUserName);
return path;
}
diff --git a/protocols/FacebookRM/src/chat.cpp b/protocols/FacebookRM/src/chat.cpp index 674bbae204..c25734b129 100644 --- a/protocols/FacebookRM/src/chat.cpp +++ b/protocols/FacebookRM/src/chat.cpp @@ -415,7 +415,7 @@ void FacebookProto::PrepareNotificationsChatRoom() { MCONTACT hNotificationsChatRoom = ChatIDToHContact(FACEBOOK_NOTIFICATIONS_CHATROOM); if (hNotificationsChatRoom == NULL || getDword(hNotificationsChatRoom, "Status", ID_STATUS_OFFLINE) != ID_STATUS_ONLINE) { TCHAR nameT[200]; - mir_sntprintf(nameT, _countof(nameT), _T("%s: %s"), m_tszUserName, TranslateT("Notifications")); + mir_sntprintf(nameT, _T("%s: %s"), m_tszUserName, TranslateT("Notifications")); // Create the group chat session GCSESSION gcw = { sizeof(gcw) }; diff --git a/protocols/FacebookRM/src/contacts.cpp b/protocols/FacebookRM/src/contacts.cpp index 7083a918ee..05afa3ed0c 100644 --- a/protocols/FacebookRM/src/contacts.cpp +++ b/protocols/FacebookRM/src/contacts.cpp @@ -313,7 +313,7 @@ void FacebookProto::LoadChatInfo(facebook_chatroom *fbc) if (fbc->participants.size() > namesUsed) { TCHAR more[200]; - mir_sntprintf(more, _countof(more), TranslateT("%s and more (%d)"), fbc->chat_name.c_str(), fbc->participants.size() - namesUsed); + mir_sntprintf(more, TranslateT("%s and more (%d)"), fbc->chat_name.c_str(), fbc->participants.size() - namesUsed); fbc->chat_name = more; } diff --git a/protocols/FacebookRM/src/dialogs.cpp b/protocols/FacebookRM/src/dialogs.cpp index 2cbcfff995..80a825acc9 100644 --- a/protocols/FacebookRM/src/dialogs.cpp +++ b/protocols/FacebookRM/src/dialogs.cpp @@ -219,7 +219,7 @@ INT_PTR CALLBACK FBMindProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lpara ptrA firstname(data->proto->getStringA(FACEBOOK_KEY_FIRST_NAME)); if (firstname != NULL) { char title[100]; - mir_snprintf(title, _countof(title), Translate("What's on your mind, %s?"), firstname); + mir_snprintf(title, Translate("What's on your mind, %s?"), firstname); SetWindowTextA(hwnd, title); } } diff --git a/protocols/FacebookRM/src/json.cpp b/protocols/FacebookRM/src/json.cpp index 3970cf44d8..69b28da0ad 100644 --- a/protocols/FacebookRM/src/json.cpp +++ b/protocols/FacebookRM/src/json.cpp @@ -391,7 +391,7 @@ void parseAttachments(FacebookProto *proto, std::string *message_text, const JSO newText = _A2T(type.c_str()); TCHAR title[200]; - mir_sntprintf(title, _countof(title), TranslateT("User sent %s:"), newText.c_str()); + mir_sntprintf(title, TranslateT("User sent %s:"), newText.c_str()); *message_text += T2Utf(title); *message_text += attachments_text; @@ -685,7 +685,7 @@ int facebook_json_parser::parse_messages(std::string *pData, std::vector< facebo StatusTextData st = { 0 }; st.cbSize = sizeof(st); - mir_sntprintf(st.tszText, _countof(st.tszText), TranslateT("%s is typing a message..."), name); + mir_sntprintf(st.tszText, TranslateT("%s is typing a message..."), name); CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)hChatContact, (LPARAM)&st); } diff --git a/protocols/FacebookRM/src/proto.cpp b/protocols/FacebookRM/src/proto.cpp index 23969b97bc..cfa288d696 100644 --- a/protocols/FacebookRM/src/proto.cpp +++ b/protocols/FacebookRM/src/proto.cpp @@ -267,7 +267,7 @@ HANDLE FacebookProto::SearchByEmail(const TCHAR* email) HANDLE FacebookProto::SearchByName(const TCHAR* nick, const TCHAR* firstName, const TCHAR* lastName) { TCHAR arg[200]; - mir_sntprintf(arg, _countof(arg), _T("%s %s %s"), nick, firstName, lastName); + mir_sntprintf(arg, _T("%s %s %s"), nick, firstName, lastName); return SearchByEmail(arg); // Facebook is using one search method for everything (except IDs) } @@ -521,7 +521,7 @@ int FacebookProto::OnToolbarInit(WPARAM, LPARAM) ttb.dwFlags = TTBBF_SHOWTOOLTIP | TTBBF_VISIBLE; char service[100]; - mir_snprintf(service, _countof(service), "%s%s", m_szModuleName, "/Mind"); + mir_snprintf(service, "%s%s", m_szModuleName, "/Mind"); ttb.pszService = service; ttb.pszTooltipUp = ttb.name = LPGEN("Share status..."); @@ -762,7 +762,7 @@ INT_PTR FacebookProto::CancelFriendship(WPARAM wParam, LPARAM lParam) return 1; TCHAR tstr[256]; - mir_sntprintf(tstr, _countof(tstr), TranslateT("Do you want to cancel your friendship with '%s'?"), tname); + mir_sntprintf(tstr, TranslateT("Do you want to cancel your friendship with '%s'?"), tname); if (MessageBox(0, tstr, m_tszUserName, MB_ICONWARNING | MB_YESNO | MB_DEFBUTTON2) == IDYES) { ptrA id(getStringA(hContact, FACEBOOK_KEY_ID)); @@ -1123,10 +1123,10 @@ void FacebookProto::MessageRead(MCONTACT hContact) if (isChatRoom(hContact)) { // Load readers names ptrT treaders(getTStringA(hContact, FACEBOOK_KEY_MESSAGE_READERS)); - mir_sntprintf(st.tszText, _countof(st.tszText), TranslateT("Message read: %s by %s"), ttime, treaders ? treaders : _T("???")); + mir_sntprintf(st.tszText, TranslateT("Message read: %s by %s"), ttime, treaders ? treaders : _T("???")); CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)hContact, (LPARAM)&st); } else if (!ServiceExists("MessageState/DummyService")){ - mir_sntprintf(st.tszText, _countof(st.tszText), TranslateT("Message read: %s"), ttime); + mir_sntprintf(st.tszText, TranslateT("Message read: %s"), ttime); CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)hContact, (LPARAM)&st); } } diff --git a/protocols/GTalkExt/src/menu.cpp b/protocols/GTalkExt/src/menu.cpp index a4721aa652..a35854bfd6 100644 --- a/protocols/GTalkExt/src/menu.cpp +++ b/protocols/GTalkExt/src/menu.cpp @@ -41,7 +41,7 @@ int InitMenus(WPARAM wParam, LPARAM lParam) if (pga != NULL) {
LPCSTR szModuleName = pga->m_japi->GetModuleName();
char szServiceName[100];
- mir_snprintf(szServiceName, _countof(szServiceName), "%s/%s", szModuleName, MS_GTALKEXT_OPENMAILBOX);
+ mir_snprintf(szServiceName, "%s/%s", szModuleName, MS_GTALKEXT_OPENMAILBOX);
CreateServiceFunctionParam(szServiceName, OpenMailboxMenuHandler, (LPARAM)szModuleName);
CMenuItem mi;
diff --git a/protocols/GTalkExt/src/notifications.cpp b/protocols/GTalkExt/src/notifications.cpp index eca670801e..6978e81507 100644 --- a/protocols/GTalkExt/src/notifications.cpp +++ b/protocols/GTalkExt/src/notifications.cpp @@ -199,7 +199,7 @@ static MEVENT AddCListNotification(MCONTACT hContact, LPCSTR acc, POPUPDATAT *da dbei.eventType = EVENTTYPE_MESSAGE;
char szEventText[4096];
- dbei.cbBlob = mir_snprintf(szEventText, _countof(szEventText), "%s\r\n%s", szUrl, szText);
+ dbei.cbBlob = mir_snprintf(szEventText, "%s\r\n%s", szUrl, szText);
dbei.pBlob = (PBYTE)szEventText;
return db_event_add(hContact, &dbei);
}
diff --git a/protocols/Gadu-Gadu/src/avatar.cpp b/protocols/Gadu-Gadu/src/avatar.cpp index c666bd591b..f560cddf89 100644 --- a/protocols/Gadu-Gadu/src/avatar.cpp +++ b/protocols/Gadu-Gadu/src/avatar.cpp @@ -389,7 +389,7 @@ void __cdecl GGPROTO::setavatarthread(void *param) size_t avatarFileB64EncLen = mir_strlen(avatarFileB64Enc);
char dataPrefix[64];
- mir_snprintf(dataPrefix, _countof(dataPrefix), "uin=%d&photo=", getDword(GG_KEY_UIN, 0));
+ mir_snprintf(dataPrefix, "uin=%d&photo=", getDword(GG_KEY_UIN, 0));
size_t dataPrefixLen = mir_strlen(dataPrefix);
size_t dataLen = dataPrefixLen + avatarFileB64EncLen;
diff --git a/protocols/Gadu-Gadu/src/core.cpp b/protocols/Gadu-Gadu/src/core.cpp index 014beec412..e56024d1c3 100644 --- a/protocols/Gadu-Gadu/src/core.cpp +++ b/protocols/Gadu-Gadu/src/core.cpp @@ -637,7 +637,7 @@ retry: _tcsncpy_s(strFmt2, pcli->pfnGetStatusModeDescription( status_gg2m(atoi(__status)), 0), _TRUNCATE);
if (__city) {
- mir_sntprintf(strFmt1, _countof(strFmt1), _T(", %s %s"), TranslateT("City:"), __city);
+ mir_sntprintf(strFmt1, _T(", %s %s"), TranslateT("City:"), __city);
mir_tstrncat(strFmt2, strFmt1, _countof(strFmt2) - mir_tstrlen(strFmt2));
}
if (__birthyear) {
@@ -646,7 +646,7 @@ retry: int br = atoi(__birthyear);
if (br < (lt->tm_year + 1900) && br > 1900) {
- mir_sntprintf(strFmt1, _countof(strFmt1), _T(", %s %d"), TranslateT("Age:"), (lt->tm_year + 1900) - br);
+ mir_sntprintf(strFmt1, _T(", %s %d"), TranslateT("Age:"), (lt->tm_year + 1900) - br);
mir_tstrncat(strFmt2, strFmt1, _countof(strFmt2) - mir_tstrlen(strFmt2));
}
}
@@ -975,7 +975,7 @@ retry: if (iIndexes && iIndexes[i])
continue;
- mir_sntprintf(szMsg, _countof(szMsg), _T("%s (%s)"), szText,
+ mir_sntprintf(szMsg, _T("%s (%s)"), szText,
*e->event.multilogon_info.sessions[i].name != '\0' ?
_A2T(e->event.multilogon_info.sessions[i].name) : TranslateT("Unknown client"));
showpopup(m_tszUserName, szMsg, GG_POPUP_MULTILOGON);
@@ -1008,7 +1008,7 @@ retry: {
CLISTEVENT cle = {0};
char service[128];
- mir_snprintf(service, _countof(service), GGS_RECVIMAGE, m_szModuleName);
+ mir_snprintf(service, GGS_RECVIMAGE, m_szModuleName);
cle.cbSize = sizeof(cle);
cle.hContact = hContact;
@@ -1716,7 +1716,7 @@ void GGPROTO::changecontactstatus(uin_t uin, int status, const TCHAR *idescr, in {
char sversion[48];
setDword(hContact, GG_KEY_CLIENTVERSION, (DWORD) version);
- mir_snprintf(sversion, _countof(sversion), "%sGadu-Gadu %s", (version & 0x00ffffff) > 0x2b ? "Nowe " : "", gg_version2string(version));
+ mir_snprintf(sversion, "%sGadu-Gadu %s", (version & 0x00ffffff) > 0x2b ? "Nowe " : "", gg_version2string(version));
setString(hContact, "MirVer", sversion);
}
}
diff --git a/protocols/Gadu-Gadu/src/dialogs.cpp b/protocols/Gadu-Gadu/src/dialogs.cpp index 722fb18a97..9c498c4e2a 100644 --- a/protocols/Gadu-Gadu/src/dialogs.cpp +++ b/protocols/Gadu-Gadu/src/dialogs.cpp @@ -68,7 +68,7 @@ static void SetValue(HWND hwndDlg, int idCtrl, MCONTACT hContact, char *szModule if (dbv.cVal == -100) unspecified = 1; else { ptstr = str; - mir_sntprintf(str, _countof(str), dbv.cVal ? _T("GMT%+d:%02d") : _T("GMT"), -dbv.cVal / 2, (dbv.cVal & 1) * 30); + mir_sntprintf(str, dbv.cVal ? _T("GMT%+d:%02d") : _T("GMT"), -dbv.cVal / 2, (dbv.cVal & 1) * 30); } } else { unspecified = (special == SVS_ZEROISUNSPEC && dbv.bVal == 0); @@ -82,7 +82,7 @@ static void SetValue(HWND hwndDlg, int idCtrl, MCONTACT hContact, char *szModule unspecified = 1; } else { ptstr = str; - mir_sntprintf(str, _countof(str), _T("%S"), pstr); + mir_sntprintf(str, _T("%S"), pstr); } } else { @@ -100,12 +100,12 @@ static void SetValue(HWND hwndDlg, int idCtrl, MCONTACT hContact, char *szModule unspecified = 1; } else { ptstr = str; - mir_sntprintf(str, _countof(str), _T("%S"), pstr); + mir_sntprintf(str, _T("%S"), pstr); } if (dbv.dVal == 0) unspecified = 1; } else if (special == SVS_GGVERSION) { ptstr = str; - mir_sntprintf(str, _countof(str), _T("%S"), (char *)gg_version2string(dbv.dVal)); + mir_sntprintf(str, _T("%S"), (char *)gg_version2string(dbv.dVal)); } else { ptstr = _itot(special == SVS_SIGNED ? dbv.lVal : dbv.dVal, str, 10); } @@ -113,7 +113,7 @@ static void SetValue(HWND hwndDlg, int idCtrl, MCONTACT hContact, char *szModule case DBVT_ASCIIZ: unspecified = (special == SVS_ZEROISUNSPEC && dbv.pszVal[0] == '\0'); ptstr = str; - mir_sntprintf(str, _countof(str), _T("%S"), dbv.pszVal); + mir_sntprintf(str, _T("%S"), dbv.pszVal); break; case DBVT_TCHAR: unspecified = (special == SVS_ZEROISUNSPEC && dbv.ptszVal[0] == '\0'); diff --git a/protocols/Gadu-Gadu/src/filetransfer.cpp b/protocols/Gadu-Gadu/src/filetransfer.cpp index dfa99bcffe..3c85052673 100644 --- a/protocols/Gadu-Gadu/src/filetransfer.cpp +++ b/protocols/Gadu-Gadu/src/filetransfer.cpp @@ -269,7 +269,7 @@ void __cdecl GGPROTO::dccmainthread(void*) {
PROTOFILETRANSFERSTATUS pfts;
local_dcc->tick = tick;
- mir_snprintf(szFilename, _countof(szFilename), "%s%s", local_dcc->folder, local_dcc->file_info.filename);
+ mir_snprintf(szFilename, "%s%s", local_dcc->folder, local_dcc->file_info.filename);
memset(&pfts, 0, sizeof(PROTOFILETRANSFERSTATUS));
pfts.cbSize = sizeof(PROTOFILETRANSFERSTATUS);
pfts.hContact = (UINT_PTR)local_dcc->contact;
@@ -299,7 +299,7 @@ void __cdecl GGPROTO::dccmainthread(void*) if (local_dcc->file_fd != -1)
{
PROTOFILETRANSFERSTATUS pfts;
- mir_snprintf(szFilename, _countof(szFilename), "%s%s", local_dcc->folder, local_dcc->file_info.filename);
+ mir_snprintf(szFilename, "%s%s", local_dcc->folder, local_dcc->file_info.filename);
memset(&pfts, 0, sizeof(PROTOFILETRANSFERSTATUS));
pfts.cbSize = sizeof(PROTOFILETRANSFERSTATUS);
pfts.hContact = (UINT_PTR)local_dcc->contact;
@@ -497,7 +497,7 @@ void __cdecl GGPROTO::dccmainthread(void*) {
PROTOFILETRANSFERSTATUS pfts;
local_dcc7->tick = tick;
- mir_snprintf(szFilename, _countof(szFilename), "%s%s", local_dcc->folder, local_dcc7->filename);
+ mir_snprintf(szFilename, "%s%s", local_dcc->folder, local_dcc7->filename);
memset(&pfts, 0, sizeof(PROTOFILETRANSFERSTATUS));
pfts.cbSize = sizeof(PROTOFILETRANSFERSTATUS);
pfts.hContact = (UINT_PTR)local_dcc7->contact;
@@ -527,7 +527,7 @@ void __cdecl GGPROTO::dccmainthread(void*) if (local_dcc7->file_fd != -1)
{
PROTOFILETRANSFERSTATUS pfts;
- mir_snprintf(szFilename, _countof(szFilename), "%s%s", local_dcc->folder, local_dcc7->filename);
+ mir_snprintf(szFilename, "%s%s", local_dcc->folder, local_dcc7->filename);
memset(&pfts, 0, sizeof(PROTOFILETRANSFERSTATUS));
pfts.cbSize = sizeof(PROTOFILETRANSFERSTATUS);
pfts.hContact = (UINT_PTR)local_dcc7->contact;
@@ -662,7 +662,7 @@ HANDLE GGPROTO::dccfileallow(HANDLE hTransfer, const TCHAR* szPath) {
struct gg_dcc *dcc = (struct gg_dcc *) hTransfer;
char fileName[MAX_PATH], *path = mir_t2a(szPath);
- mir_snprintf(fileName, _countof(fileName), "%s%s", path, dcc->file_info.filename);
+ mir_snprintf(fileName, "%s%s", path, dcc->file_info.filename);
dcc->folder = _strdup((char*)path);
dcc->tick = 0;
mir_free(path);
@@ -702,7 +702,7 @@ HANDLE GGPROTO::dcc7fileallow(HANDLE hTransfer, const TCHAR* szPath) {
struct gg_dcc7 *dcc7 = (struct gg_dcc7 *) hTransfer;
char fileName[MAX_PATH], *path = mir_t2a(szPath);
- mir_snprintf(fileName, _countof(fileName), "%s%s", path, dcc7->filename);
+ mir_snprintf(fileName, "%s%s", path, dcc7->filename);
dcc7->folder = _strdup((char*)path);
dcc7->tick = 0;
mir_free(path);
diff --git a/protocols/Gadu-Gadu/src/gg.cpp b/protocols/Gadu-Gadu/src/gg.cpp index af3bd97329..31d0aa96fb 100644 --- a/protocols/Gadu-Gadu/src/gg.cpp +++ b/protocols/Gadu-Gadu/src/gg.cpp @@ -65,9 +65,9 @@ TCHAR* ws_strerror(int code) TCHAR buff[128];
int len = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, WSAGetLastError(), 0, buff, _countof(buff), NULL);
if (len == 0)
- mir_sntprintf(err_desc, _countof(err_desc), _T("WinSock %u: Unknown error."), WSAGetLastError());
+ mir_sntprintf(err_desc, _T("WinSock %u: Unknown error."), WSAGetLastError());
else
- mir_sntprintf(err_desc, _countof(err_desc), _T("WinSock %d: %s"), WSAGetLastError(), buff);
+ mir_sntprintf(err_desc, _T("WinSock %d: %s"), WSAGetLastError(), buff);
return err_desc;
}
@@ -154,18 +154,18 @@ void GGPROTO::cleanuplastplugin(DWORD version) debugLogA("cleanuplastplugin() 1: version=%d Cleaning junk avatar files from < 0.11.0.2", version);
TCHAR avatarsPath[MAX_PATH];
- mir_sntprintf(avatarsPath, _countof(avatarsPath), _T("%s\\%s"), VARST( _T("%miranda_avatarcache%")), m_tszUserName);
+ mir_sntprintf(avatarsPath, _T("%s\\%s"), VARST( _T("%miranda_avatarcache%")), m_tszUserName);
debugLog(_T("cleanuplastplugin() 1: miranda_avatarcache = %s"), avatarsPath);
TCHAR spec[MAX_PATH + 10];
- mir_sntprintf(spec, _countof(spec), _T("%s\\*.(null)"), avatarsPath);
+ mir_sntprintf(spec, _T("%s\\*.(null)"), avatarsPath);
WIN32_FIND_DATA ffd;
HANDLE hFind = FindFirstFile(spec, &ffd);
if (hFind != INVALID_HANDLE_VALUE) {
do {
TCHAR filePathT [2*MAX_PATH + 10];
- mir_sntprintf(filePathT, _countof(filePathT), _T("%s\\%s"), avatarsPath, ffd.cFileName);
+ mir_sntprintf(filePathT, _T("%s\\%s"), avatarsPath, ffd.cFileName);
if (!_taccess(filePathT, 0)){
debugLog(_T("cleanuplastplugin() 1: remove file = %s"), filePathT);
_tremove(filePathT);
@@ -410,7 +410,7 @@ void gg_debughandler(int level, const char *format, va_list ap) strncpy(szText + PREFIXLEN, "[libgadu] \0", sizeof(szText) - PREFIXLEN);
char prefix[6];
- mir_snprintf(prefix, _countof(prefix), "%lu", GetCurrentThreadId());
+ mir_snprintf(prefix, "%lu", GetCurrentThreadId());
size_t prefixLen = mir_strlen(prefix);
if (prefixLen < PREFIXLEN) memset(prefix + prefixLen, ' ', PREFIXLEN - prefixLen);
memcpy(szText, prefix, PREFIXLEN);
diff --git a/protocols/Gadu-Gadu/src/gg_proto.cpp b/protocols/Gadu-Gadu/src/gg_proto.cpp index 855542a409..3bcfd97cd5 100644 --- a/protocols/Gadu-Gadu/src/gg_proto.cpp +++ b/protocols/Gadu-Gadu/src/gg_proto.cpp @@ -40,7 +40,7 @@ GGPROTO::GGPROTO(const char *pszProtoName, const TCHAR *tszUserName) : // Register m_hNetlibUser user
TCHAR name[128];
- mir_sntprintf(name, _countof(name), TranslateT("%s connection"), m_tszUserName);
+ mir_sntprintf(name, TranslateT("%s connection"), m_tszUserName);
NETLIBUSER nlu = { 0 };
nlu.cbSize = sizeof(nlu);
diff --git a/protocols/Gadu-Gadu/src/groupchat.cpp b/protocols/Gadu-Gadu/src/groupchat.cpp index 4e2bfc3038..51767d71fe 100644 --- a/protocols/Gadu-Gadu/src/groupchat.cpp +++ b/protocols/Gadu-Gadu/src/groupchat.cpp @@ -43,7 +43,7 @@ int GGPROTO::gc_init() gc_enabled = TRUE;
// create & hook event
- mir_snprintf(service, _countof(service), GG_GC_GETCHAT, m_szModuleName);
+ mir_snprintf(service, GG_GC_GETCHAT, m_szModuleName);
debugLogA("gc_init(): Registered with groupchat plugin.");
}
else debugLogA("gc_init(): Cannot register with groupchat plugin !!!");
@@ -299,7 +299,7 @@ TCHAR* GGPROTO::gc_getchat(uin_t sender, uin_t *recipients, int recipients_count // Create new chat window
TCHAR status[256];
TCHAR *senderName = sender ? pcli->pfnGetContactDisplayName(getcontact(sender, 1, 0, NULL), 0) : NULL;
- mir_sntprintf(status, _countof(status), (sender) ? TranslateT("%s initiated the conference.") : TranslateT("This is my own conference."), senderName);
+ mir_sntprintf(status, (sender) ? TranslateT("%s initiated the conference.") : TranslateT("This is my own conference."), senderName);
GCSESSION gcwindow = { sizeof(gcwindow) };
gcwindow.iType = GCW_CHATROOM;
diff --git a/protocols/Gadu-Gadu/src/icolib.cpp b/protocols/Gadu-Gadu/src/icolib.cpp index c527755058..ea6e2503a2 100644 --- a/protocols/Gadu-Gadu/src/icolib.cpp +++ b/protocols/Gadu-Gadu/src/icolib.cpp @@ -51,7 +51,7 @@ void gg_icolib_init() HICON LoadIconEx(const char* name, bool big)
{
char szSettingName[100];
- mir_snprintf(szSettingName, _countof(szSettingName), "%s_%s", GGDEF_PROTO, name);
+ mir_snprintf(szSettingName, "%s_%s", GGDEF_PROTO, name);
return IcoLib_GetIcon(szSettingName, big);
}
@@ -66,7 +66,7 @@ HANDLE GetIconHandle(int iconId) void ReleaseIconEx(const char* name, bool big)
{
char szSettingName[100];
- mir_snprintf(szSettingName, _countof(szSettingName), "%s_%s", GGDEF_PROTO, name);
+ mir_snprintf(szSettingName, "%s_%s", GGDEF_PROTO, name);
IcoLib_Release(szSettingName, big);
}
diff --git a/protocols/Gadu-Gadu/src/image.cpp b/protocols/Gadu-Gadu/src/image.cpp index 8f03d5bd26..5cc84e4942 100644 --- a/protocols/Gadu-Gadu/src/image.cpp +++ b/protocols/Gadu-Gadu/src/image.cpp @@ -845,7 +845,7 @@ int GGPROTO::img_displayasmsg(MCONTACT hContact, void *img) if (res != 0) {
TCHAR image_msg[MAX_PATH + 11];
- mir_sntprintf(image_msg, _countof(image_msg), _T("[img]%s[/img]"), szPath);
+ mir_sntprintf(image_msg, _T("[img]%s[/img]"), szPath);
T2Utf szMessage(image_msg);
PROTORECVEVENT pre = {0};
diff --git a/protocols/Gadu-Gadu/src/oauth.cpp b/protocols/Gadu-Gadu/src/oauth.cpp index 4aad3c3838..be19ab681c 100644 --- a/protocols/Gadu-Gadu/src/oauth.cpp +++ b/protocols/Gadu-Gadu/src/oauth.cpp @@ -248,7 +248,7 @@ char *oauth_auth_header(const char *httpmethod, const char *url, OAUTHSIGNMETHOD case RSASHA1: oauth_setparam(oauth_parameters, "oauth_signature_method", "RSA-SHA1"); break;
default: oauth_setparam(oauth_parameters, "oauth_signature_method", "PLAINTEXT"); break;
};
- mir_snprintf(timestamp, _countof(timestamp), "%ld", time(NULL));
+ mir_snprintf(timestamp, "%ld", time(NULL));
oauth_setparam(oauth_parameters, "oauth_timestamp", timestamp);
oauth_setparam(oauth_parameters, "oauth_nonce", ptrA(oauth_generate_nonce()));
if (token != NULL && *token)
diff --git a/protocols/Gadu-Gadu/src/popups.cpp b/protocols/Gadu-Gadu/src/popups.cpp index ea440fb6b0..daf2d252a6 100644 --- a/protocols/Gadu-Gadu/src/popups.cpp +++ b/protocols/Gadu-Gadu/src/popups.cpp @@ -87,16 +87,16 @@ void GGPROTO::initpopups() puc.hIcon = CopyIcon(LoadIconEx("main", FALSE));
ReleaseIconEx("main", FALSE);
puc.iSeconds = 4;
- mir_sntprintf(szDescr, _countof(szDescr), _T("%s/%s"), m_tszUserName, TranslateT("Notify"));
- mir_snprintf(szName, _countof(szName), "%s_%s", m_szModuleName, "Notify");
+ mir_sntprintf(szDescr, _T("%s/%s"), m_tszUserName, TranslateT("Notify"));
+ mir_snprintf(szName, "%s_%s", m_szModuleName, "Notify");
hPopupNotify = Popup_RegisterClass(&puc);
puc.colorBack = RGB(191, 0, 0); // Red
puc.colorText = RGB(255, 245, 225); // Yellow
puc.iSeconds = 60;
puc.hIcon = (HICON)LoadImage(NULL, IDI_WARNING, IMAGE_ICON, 0, 0, LR_SHARED);
- mir_sntprintf(szDescr, _countof(szDescr), _T("%s/%s"), m_tszUserName, TranslateT("Error"));
- mir_snprintf(szName, _countof(szName), "%s_%s", m_szModuleName, "Error");
+ mir_sntprintf(szDescr, _T("%s/%s"), m_tszUserName, TranslateT("Error"));
+ mir_snprintf(szName, "%s_%s", m_szModuleName, "Error");
hPopupError = Popup_RegisterClass(&puc);
}
@@ -117,9 +117,9 @@ void CALLBACK sttMainThreadCallback(PVOID dwParam) ppd.pszClassName = szName;
if (puData->flags & GG_POPUP_ERROR || puData->flags & GG_POPUP_WARNING)
- mir_snprintf(szName, _countof(szName), "%s_%s", gg->m_szModuleName, "Error");
+ mir_snprintf(szName, "%s_%s", gg->m_szModuleName, "Error");
else
- mir_snprintf(szName, _countof(szName), "%s_%s", gg->m_szModuleName, "Notify");
+ mir_snprintf(szName, "%s_%s", gg->m_szModuleName, "Notify");
CallService(MS_POPUP_ADDPOPUPCLASS, 0, (LPARAM)&ppd);
return;
diff --git a/protocols/Gadu-Gadu/src/services.cpp b/protocols/Gadu-Gadu/src/services.cpp index 077e9ab556..5fa6fb5612 100644 --- a/protocols/Gadu-Gadu/src/services.cpp +++ b/protocols/Gadu-Gadu/src/services.cpp @@ -42,7 +42,7 @@ char *gg_status2db(int status, const char *suffix) }
static char str[64];
- mir_snprintf(str, _countof(str), "%s%s", prefix, suffix);
+ mir_snprintf(str, "%s%s", prefix, suffix);
return str;
}
@@ -219,7 +219,7 @@ INT_PTR GGPROTO::getavatarinfo(WPARAM wParam, LPARAM lParam) char *AvatarName = strrchr(AvatarURL, '/');
AvatarName++;
char AvatarNameWithTS[128];
- mir_snprintf(AvatarNameWithTS, _countof(AvatarNameWithTS), "%s%s", AvatarName, AvatarTs);
+ mir_snprintf(AvatarNameWithTS, "%s%s", AvatarName, AvatarTs);
AvatarHash = gg_avatarhash(AvatarNameWithTS);
}
diff --git a/protocols/Gadu-Gadu/src/sessions.cpp b/protocols/Gadu-Gadu/src/sessions.cpp index 001d2189b9..49a84ea229 100644 --- a/protocols/Gadu-Gadu/src/sessions.cpp +++ b/protocols/Gadu-Gadu/src/sessions.cpp @@ -168,7 +168,7 @@ static INT_PTR CALLBACK gg_sessions_viewdlg(HWND hwndDlg, UINT message, WPARAM w HANDLE hProtoAckEvent;
GetWindowText(hwndDlg, oldTitle, _countof(oldTitle));
- mir_sntprintf(newTitle, _countof(newTitle), oldTitle, gg->m_tszUserName);
+ mir_sntprintf(newTitle, oldTitle, gg->m_tszUserName);
SetWindowText(hwndDlg, newTitle);
WindowSetIcon(hwndDlg, "sessions");
@@ -346,7 +346,7 @@ static INT_PTR CALLBACK gg_sessions_viewdlg(HWND hwndDlg, UINT message, WPARAM w TCHAR szUrl[256], szIP[64];
szIP[0] = 0;
ListView_GetItemText(hList, lvhti.iItem, 1, szIP, _countof(szIP));
- mir_sntprintf(szUrl, _countof(szUrl), _T("http://whois.domaintools.com/%s"), szIP);
+ mir_sntprintf(szUrl, _T("http://whois.domaintools.com/%s"), szIP);
Utils_OpenUrlT(szUrl);
break;
}
diff --git a/protocols/IRCG/src/clist.cpp b/protocols/IRCG/src/clist.cpp index 8e403f4198..d63dc3cfc1 100644 --- a/protocols/IRCG/src/clist.cpp +++ b/protocols/IRCG/src/clist.cpp @@ -69,7 +69,7 @@ BOOL CIrcProto::CList_AddDCCChat(const CMString& name, const CMString& hostmask, cle.hIcon = LoadIconEx(IDI_DCC);
mir_snprintf(szService, "%s/DblClickEvent", m_szModuleName);
cle.pszService = szService;
- mir_sntprintf(szNick, _countof(szNick), TranslateT("CTCP chat request from %s"), name.c_str());
+ mir_sntprintf(szNick, TranslateT("CTCP chat request from %s"), name.c_str());
cle.ptszTooltip = szNick;
cle.lParam = (LPARAM)pdci;
diff --git a/protocols/IRCG/src/commandmonitor.cpp b/protocols/IRCG/src/commandmonitor.cpp index a73cec6b40..41befe1236 100644 --- a/protocols/IRCG/src/commandmonitor.cpp +++ b/protocols/IRCG/src/commandmonitor.cpp @@ -70,9 +70,9 @@ VOID CALLBACK KeepAliveTimerProc(HWND, UINT, UINT_PTR idEvent, DWORD) TCHAR temp2[270];
if (!ppro->m_info.sServerName.IsEmpty())
- mir_sntprintf(temp2, _countof(temp2), _T("PING %s"), ppro->m_info.sServerName.c_str());
+ mir_sntprintf(temp2, _T("PING %s"), ppro->m_info.sServerName.c_str());
else
- mir_sntprintf(temp2, _countof(temp2), _T("PING %u"), time(0));
+ mir_sntprintf(temp2, _T("PING %u"), time(0));
if (ppro->IsConnected())
ppro->SendIrcMessage(temp2, false);
@@ -259,7 +259,7 @@ void __cdecl CIrcProto::ResolveIPThread(LPVOID di) bool CIrcProto::OnIrc_PING(const CIrcMessage* pmsg)
{
TCHAR szResponse[100];
- mir_sntprintf(szResponse, _countof(szResponse), _T("PONG %s"), pmsg->parameters[0].c_str());
+ mir_sntprintf(szResponse, _T("PONG %s"), pmsg->parameters[0].c_str());
SendIrcMessage(szResponse);
return false;
}
@@ -670,7 +670,7 @@ bool CIrcProto::OnIrc_PINGPONG(const CIrcMessage* pmsg) {
if (pmsg->m_bIncoming && pmsg->sCommand == _T("PING")) {
TCHAR szResponse[100];
- mir_sntprintf(szResponse, _countof(szResponse), _T("PONG %s"), pmsg->parameters[0].c_str());
+ mir_sntprintf(szResponse, _T("PONG %s"), pmsg->parameters[0].c_str());
SendIrcMessage(szResponse);
}
@@ -1677,7 +1677,7 @@ bool CIrcProto::OnIrc_WHOIS_OTHER(const CIrcMessage* pmsg) TCHAR temp[1024], temp2[1024];
m_whoisDlg->m_InfoOther.GetText(temp, 1000);
mir_tstrcat(temp, _T("%s\r\n"));
- mir_sntprintf(temp2, _countof(temp2), temp, pmsg->parameters[2].c_str());
+ mir_sntprintf(temp2, temp, pmsg->parameters[2].c_str());
m_whoisDlg->m_InfoOther.SetText(temp2);
}
ShowMessage(pmsg);
@@ -1727,7 +1727,7 @@ bool CIrcProto::OnIrc_WHOIS_IDLE(const CIrcMessage* pmsg) TCHAR tTimeBuf[128], *tStopStr;
time_t ttTime = _tcstol(pmsg->parameters[3].c_str(), &tStopStr, 10);
_tcsftime(tTimeBuf, 128, _T("%c"), localtime(&ttTime));
- mir_sntprintf(temp3, _countof(temp3), TranslateT("online since %s, idle %s"), tTimeBuf, temp);
+ mir_sntprintf(temp3, TranslateT("online since %s, idle %s"), tTimeBuf, temp);
m_whoisDlg->m_AwayTime.SetText(temp3);
}
ShowMessage(pmsg);
@@ -1813,7 +1813,7 @@ bool CIrcProto::OnIrc_NICK_ERR(const CIrcMessage* pmsg) if (pmsg->m_bIncoming) {
if (nickflag && ((m_alternativeNick[0] != 0)) && (pmsg->parameters.getCount() > 2 && mir_tstrcmp(pmsg->parameters[1].c_str(), m_alternativeNick))) {
TCHAR m[200];
- mir_sntprintf(m, _countof(m), _T("NICK %s"), m_alternativeNick);
+ mir_sntprintf(m, _T("NICK %s"), m_alternativeNick);
if (IsConnected())
SendIrcMessage(m);
}
diff --git a/protocols/IRCG/src/input.cpp b/protocols/IRCG/src/input.cpp index d5967a7b22..ef2611db39 100644 --- a/protocols/IRCG/src/input.cpp +++ b/protocols/IRCG/src/input.cpp @@ -121,7 +121,7 @@ CMString CIrcProto::DoAlias(const TCHAR *text, TCHAR *window) TCHAR buf[5];
for (int index = 1; index < 8; index++) {
- mir_sntprintf(buf, _countof(buf), _T("#$%u"), index);
+ mir_sntprintf(buf, _T("#$%u"), index);
if (!GetWord(line, index).IsEmpty() && IsChannel(GetWord(line, index)))
str.Replace(buf, GetWord(line, index).c_str());
else {
@@ -131,11 +131,11 @@ CMString CIrcProto::DoAlias(const TCHAR *text, TCHAR *window) }
}
for (int index2 = 1; index2 < 8; index2++) {
- mir_sntprintf(buf, _countof(buf), _T("$%u-"), index2);
+ mir_sntprintf(buf, _T("$%u-"), index2);
str.Replace(buf, GetWordAddress(line, index2));
}
for (int index3 = 1; index3 < 8; index3++) {
- mir_sntprintf(buf, _countof(buf), _T("$%u"), index3);
+ mir_sntprintf(buf, _T("$%u"), index3);
str.Replace(buf, GetWord(line, index3).c_str());
}
Messageout += GetWordAddress(str.c_str(), 1);
diff --git a/protocols/IRCG/src/ircproto.cpp b/protocols/IRCG/src/ircproto.cpp index 9625abd87a..91c2744542 100644 --- a/protocols/IRCG/src/ircproto.cpp +++ b/protocols/IRCG/src/ircproto.cpp @@ -181,15 +181,15 @@ int CIrcProto::OnModulesLoaded(WPARAM, LPARAM) nlu.cbSize = sizeof(nlu);
nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS | NUF_TCHAR;
nlu.szSettingsModule = m_szModuleName;
- mir_sntprintf(name, _countof(name), TranslateT("%s server connection"), m_tszUserName);
+ mir_sntprintf(name, TranslateT("%s server connection"), m_tszUserName);
nlu.ptszDescriptiveName = name;
m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS | NUF_TCHAR;
char szTemp2[256];
- mir_snprintf(szTemp2, _countof(szTemp2), "%s DCC", m_szModuleName);
+ mir_snprintf(szTemp2, "%s DCC", m_szModuleName);
nlu.szSettingsModule = szTemp2;
- mir_sntprintf(name, _countof(name), TranslateT("%s client-to-client connections"), m_tszUserName);
+ mir_sntprintf(name, TranslateT("%s client-to-client connections"), m_tszUserName);
nlu.ptszDescriptiveName = name;
hNetlibDCC = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
@@ -274,13 +274,13 @@ int CIrcProto::OnModulesLoaded(WPARAM, LPARAM) if (m_nick[0]) {
TCHAR szBuf[40];
if (mir_tstrlen(m_alternativeNick) == 0) {
- mir_sntprintf(szBuf, _countof(szBuf), _T("%s%u"), m_nick, rand() % 9999);
+ mir_sntprintf(szBuf, _T("%s%u"), m_nick, rand() % 9999);
setTString("AlernativeNick", szBuf);
mir_tstrncpy(m_alternativeNick, szBuf, 30);
}
if (mir_tstrlen(m_name) == 0) {
- mir_sntprintf(szBuf, _countof(szBuf), _T("Miranda%u"), rand() % 9999);
+ mir_sntprintf(szBuf, _T("Miranda%u"), rand() % 9999);
setTString("Name", szBuf);
mir_tstrncpy(m_name, szBuf, 200);
}
diff --git a/protocols/IRCG/src/options.cpp b/protocols/IRCG/src/options.cpp index dff5b71451..e187f941e6 100644 --- a/protocols/IRCG/src/options.cpp +++ b/protocols/IRCG/src/options.cpp @@ -398,7 +398,7 @@ struct CServerDlg : public CProtoDlgBase<CIrcProto> pData->m_name = m_server.GetTextA();
char temp[255];
- mir_snprintf(temp, _countof(temp), "%s: %s", pData->m_group, pData->m_name);
+ mir_snprintf(temp, "%s: %s", pData->m_group, pData->m_name);
mir_free(pData->m_name);
pData->m_name = mir_strdup(temp);
@@ -776,9 +776,9 @@ void CConnectPrefsDlg::OnApply() char TextLine[512];
if (pData->m_iSSL > 0)
- mir_snprintf(TextLine, _countof(TextLine), "SERVER:SSL%u%s:%d-%dGROUP:%s", pData->m_iSSL, pData->m_address, pData->m_portStart, pData->m_portEnd, pData->m_group);
+ mir_snprintf(TextLine, "SERVER:SSL%u%s:%d-%dGROUP:%s", pData->m_iSSL, pData->m_address, pData->m_portStart, pData->m_portEnd, pData->m_group);
else
- mir_snprintf(TextLine, _countof(TextLine), "SERVER:%s:%d-%dGROUP:%s", pData->m_address, pData->m_portStart, pData->m_portEnd, pData->m_group);
+ mir_snprintf(TextLine, "SERVER:%s:%d-%dGROUP:%s", pData->m_address, pData->m_portStart, pData->m_portEnd, pData->m_group);
db_set_s(NULL, SERVERSMODULE, pData->m_name, TextLine);
// combobox might contain new items
@@ -1372,7 +1372,7 @@ void CIrcProto::InitIgnore(void) int idx = 0;
char settingName[40];
for (;;) {
- mir_snprintf(settingName, _countof(settingName), "IGNORE:%d", idx++);
+ mir_snprintf(settingName, "IGNORE:%d", idx++);
DBVARIANT dbv;
if (getTString(settingName, &dbv))
@@ -1392,13 +1392,13 @@ void CIrcProto::RewriteIgnoreSettings(void) int i = 0;
for (;;) {
- mir_snprintf(settingName, _countof(settingName), "IGNORE:%d", i++);
+ mir_snprintf(settingName, "IGNORE:%d", i++);
if (db_unset(NULL, m_szModuleName, settingName))
break;
}
for (i = 0; i < m_ignoreItems.getCount(); i++) {
- mir_snprintf(settingName, _countof(settingName), "IGNORE:%d", i);
+ mir_snprintf(settingName, "IGNORE:%d", i);
CIrcIgnoreItem& C = m_ignoreItems[i];
setTString(settingName, (C.mask + _T(" ") + C.flags + _T(" ") + C.network).c_str());
diff --git a/protocols/IRCG/src/services.cpp b/protocols/IRCG/src/services.cpp index 579c409c47..8a293c72da 100644 --- a/protocols/IRCG/src/services.cpp +++ b/protocols/IRCG/src/services.cpp @@ -116,7 +116,7 @@ int IrcPrebuildContactMenu(WPARAM wParam, LPARAM lParam) void InitContactMenus(void)
{
char temp[MAXMODULELABELLENGTH];
- char *d = temp + mir_snprintf(temp, _countof(temp), "IRC");
+ char *d = temp + mir_snprintf(temp, "IRC");
CMenuItem mi;
mi.pszService = temp;
@@ -438,7 +438,7 @@ static void DoChatFormatting(TCHAR* pszText) if (p1 - 3 >= pszText && p1[-3] == '\003')
mir_tstrcpy(InsertThis, _T(","));
else if (iFG >= 0)
- mir_sntprintf(InsertThis, _countof(InsertThis), _T("\x03%u,"), iFG);
+ mir_sntprintf(InsertThis, _T("\x03%u,"), iFG);
else
mir_tstrcpy(InsertThis, _T("\x0399,"));
@@ -447,7 +447,7 @@ static void DoChatFormatting(TCHAR* pszText) case 'F':
if (iFG >= 0)
- mir_sntprintf(InsertThis, _countof(InsertThis), _T("\x03%u,99"), iFG);
+ mir_sntprintf(InsertThis, _T("\x03%u,99"), iFG);
else
mir_tstrcpy(InsertThis, _T("\x0399,99"));
iRemoveChars = 2;
diff --git a/protocols/IRCG/src/windows.cpp b/protocols/IRCG/src/windows.cpp index 2b40c291fe..fded5db590 100644 --- a/protocols/IRCG/src/windows.cpp +++ b/protocols/IRCG/src/windows.cpp @@ -376,13 +376,13 @@ INT_PTR CListDlg::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) ShowWindow(m_list.GetHwnd(), SW_HIDE);
// New dialog title
- mir_sntprintf(newTitle, _countof(newTitle), TranslateT("%s - Filtered - %d items"), strFilterText, itemCount);
+ mir_sntprintf(newTitle, TranslateT("%s - Filtered - %d items"), strFilterText, itemCount);
SetWindowText(m_hwnd, newTitle);
}
else {
ShowWindow(m_list.GetHwnd(), SW_SHOW);
ShowWindow(m_list2.GetHwnd(), SW_HIDE);
- mir_sntprintf(newTitle, _countof(newTitle), TranslateT("Channels on server"));
+ mir_sntprintf(newTitle, TranslateT("Channels on server"));
SetWindowText(m_hwnd, newTitle);
}
}
@@ -967,7 +967,7 @@ void CManagerDlg::OnAdd(CCtrlButton*) TCHAR temp2[450];
TCHAR window[256];
GetDlgItemText(m_hwnd, IDC_CAPTION, window, _countof(window));
- mir_sntprintf(temp2, _countof(temp2), _T("/MODE %s %s %s"), window, mode, _T("%question"));
+ mir_sntprintf(temp2, _T("/MODE %s %s %s"), window, mode, _T("%question"));
SetDlgItemText(addban_hWnd, IDC_HIDDENEDIT, temp2);
dlg->Activate();
}
@@ -1010,7 +1010,7 @@ void CManagerDlg::OnEdit(CCtrlButton*) TCHAR temp2[450];
TCHAR window[256];
GetDlgItemText(m_hwnd, IDC_CAPTION, window, _countof(window));
- mir_sntprintf(temp2, _countof(temp2), _T("/MODE %s -%s %s%s/MODE %s +%s %s"), window, mode, user.c_str(), _T("%newl"), window, mode, _T("%question"));
+ mir_sntprintf(temp2, _T("/MODE %s -%s %s%s/MODE %s +%s %s"), window, mode, user.c_str(), _T("%newl"), window, mode, _T("%question"));
SetDlgItemText(addban_hWnd, IDC_HIDDENEDIT, temp2);
dlg->Activate();
}
diff --git a/protocols/IcqOscarJ/src/fam_01service.cpp b/protocols/IcqOscarJ/src/fam_01service.cpp index d1361cf9f3..25610a5bf7 100644 --- a/protocols/IcqOscarJ/src/fam_01service.cpp +++ b/protocols/IcqOscarJ/src/fam_01service.cpp @@ -735,7 +735,7 @@ void CIcqProto::handleServUINSettings(int nPort, serverthread_info *info) // prepare mood id
if (m_bMoodsEnabled && bXStatus && moodXStatus[bXStatus - 1] != -1)
- mir_snprintf(szMoodData, _countof(szMoodData), "icqmood%d", moodXStatus[bXStatus - 1]);
+ mir_snprintf(szMoodData, "icqmood%d", moodXStatus[bXStatus - 1]);
else
szMoodData[0] = '\0';
diff --git a/protocols/IcqOscarJ/src/fam_04message.cpp b/protocols/IcqOscarJ/src/fam_04message.cpp index e8afe60295..f0f32a831b 100644 --- a/protocols/IcqOscarJ/src/fam_04message.cpp +++ b/protocols/IcqOscarJ/src/fam_04message.cpp @@ -2602,7 +2602,7 @@ void CIcqProto::handleTypingNotification(BYTE *buf, size_t wLen) char szMsg[MAX_PATH];
char *nick = NickFromHandleUtf(hContact);
- mir_snprintf(szMsg, _countof(szMsg), ICQTranslateUtfStatic(LPGEN("Contact \"%s\" has closed the message window."), szFormat, MAX_PATH), nick);
+ mir_snprintf(szMsg, ICQTranslateUtfStatic(LPGEN("Contact \"%s\" has closed the message window."), szFormat, MAX_PATH), nick);
ShowPopupMsg(hContact, ICQTranslateUtfStatic(LPGEN("ICQ Note"), szFormat, MAX_PATH), szMsg, LOG_NOTE);
SAFE_FREE((void**)&nick);
diff --git a/protocols/IcqOscarJ/src/fam_13servclist.cpp b/protocols/IcqOscarJ/src/fam_13servclist.cpp index 4d52f6fc21..a447dfe7dc 100644 --- a/protocols/IcqOscarJ/src/fam_13servclist.cpp +++ b/protocols/IcqOscarJ/src/fam_13servclist.cpp @@ -181,7 +181,7 @@ void CIcqProto::handleServCListFam(BYTE *pBuffer, size_t wBufferLength, snac_hea break; char szLogText[MAX_PATH]; - mir_snprintf(szLogText, _countof(szLogText), szChange, nItems); + mir_snprintf(szLogText, szChange, nItems); debugLogA("Server sent SNAC(x13,x%02x) - %s", pSnacHeader->wSubtype, szLogText); } break; diff --git a/protocols/IcqOscarJ/src/fam_15icqserver.cpp b/protocols/IcqOscarJ/src/fam_15icqserver.cpp index 7c6a406454..654bfa7f2e 100644 --- a/protocols/IcqOscarJ/src/fam_15icqserver.cpp +++ b/protocols/IcqOscarJ/src/fam_15icqserver.cpp @@ -525,7 +525,7 @@ int CIcqProto::parseUserInfoRecord(MCONTACT hContact, oscar_tlv *pData, UserInfo for (int i = 0; i < nRecordDef; i++) {
char szItemKey[MAX_PATH];
- mir_snprintf(szItemKey, _countof(szItemKey), pRecordDef[i].szDbSetting, nRecords);
+ mir_snprintf(szItemKey, pRecordDef[i].szDbSetting, nRecords);
switch (pRecordDef[i].dbType) {
case DBVT_UTF8:
@@ -550,7 +550,7 @@ int CIcqProto::parseUserInfoRecord(MCONTACT hContact, oscar_tlv *pData, UserInfo for (int i = nRecords; i <= nMaxRecords; i++)
for (int j = 0; j < nRecordDef; j++) {
char szItemKey[MAX_PATH];
- mir_snprintf(szItemKey, _countof(szItemKey), pRecordDef[j].szDbSetting, i);
+ mir_snprintf(szItemKey, pRecordDef[j].szDbSetting, i);
delSetting(hContact, szItemKey);
}
diff --git a/protocols/IcqOscarJ/src/icq_avatar.cpp b/protocols/IcqOscarJ/src/icq_avatar.cpp index 53caf1b702..284ccf03d4 100644 --- a/protocols/IcqOscarJ/src/icq_avatar.cpp +++ b/protocols/IcqOscarJ/src/icq_avatar.cpp @@ -1211,7 +1211,7 @@ void avatars_server_connection::handleAvatarFam(BYTE *pBuffer, size_t wBufferLen const TCHAR *ptszExt;
int dwPaFormat = ProtoGetBufferFormat(pBuffer, &ptszExt);
TCHAR tszImageFile[MAX_PATH];
- mir_sntprintf(tszImageFile, _countof(tszImageFile), _T("%s%s"), pCookieData->szFile, ptszExt);
+ mir_sntprintf(tszImageFile, _T("%s%s"), pCookieData->szFile, ptszExt);
ppro->setByte(pCookieData->hContact, "AvatarType", (BYTE)dwPaFormat);
ai.format = dwPaFormat; // set the format
diff --git a/protocols/IcqOscarJ/src/icq_clients.cpp b/protocols/IcqOscarJ/src/icq_clients.cpp index 0993175820..1eaa7898ae 100644 --- a/protocols/IcqOscarJ/src/icq_clients.cpp +++ b/protocols/IcqOscarJ/src/icq_clients.cpp @@ -473,7 +473,7 @@ const char* CIcqProto::detectUserClient( else if (MatchCapability(caps, wLen, &capQipInfium)) {
mir_strcpy(szClientBuf, "QIP Infium");
if (dwFT1) {
- mir_snprintf(ver, _countof(ver), " (%d)", dwFT1);
+ mir_snprintf(ver, " (%d)", dwFT1);
mir_strcat(szClientBuf, ver);
}
if (dwFT2 == 0x0B)
@@ -484,7 +484,7 @@ const char* CIcqProto::detectUserClient( else if (MatchCapability(caps, wLen, &capQip2010, 12)) {
mir_strcpy(szClientBuf, "QIP 2010");
if (dwFT1) {
- mir_snprintf(ver, _countof(ver), " (%d)", dwFT1);
+ mir_snprintf(ver, " (%d)", dwFT1);
mir_strcat(szClientBuf, ver);
}
@@ -493,7 +493,7 @@ const char* CIcqProto::detectUserClient( else if (MatchCapability(caps, wLen, &capQip2012, 12)) {
mir_strcpy(szClientBuf, "QIP 2012");
if (dwFT1) {
- mir_snprintf(ver, _countof(ver), " (%d)", dwFT1);
+ mir_snprintf(ver, " (%d)", dwFT1);
mir_strcat(szClientBuf, ver);
}
@@ -507,7 +507,7 @@ const char* CIcqProto::detectUserClient( mir_snprintf(szClientBuf, 64, cliQip, ver);
if (dwFT1 && dwFT2 == 0x0E) {
- mir_snprintf(ver, _countof(ver), " (%d%d%d%d)", dwFT1 >> 0x18, (dwFT1 >> 0x10) & 0xFF, (dwFT1 >> 0x08) & 0xFF, dwFT1 & 0xFF);
+ mir_snprintf(ver, " (%d%d%d%d)", dwFT1 >> 0x18, (dwFT1 >> 0x10) & 0xFF, (dwFT1 >> 0x08) & 0xFF, dwFT1 & 0xFF);
mir_strcat(szClientBuf, ver);
}
szClient = szClientBuf;
@@ -528,7 +528,7 @@ const char* CIcqProto::detectUserClient( if (dwFT2 == 0x0FFFF0011 && dwFT3 == 0x1100FFFF && (dwFT1 >> 0x18)) {
char ver[16];
- mir_snprintf(ver, _countof(ver), " %d.%d", dwFT1 >> 0x18, (dwFT1 >> 0x10) & 0xFF);
+ mir_snprintf(ver, " %d.%d", dwFT1 >> 0x18, (dwFT1 >> 0x10) & 0xFF);
if ((dwFT1 & 0xFF) == 0x0B)
mir_strcat(ver, " Beta");
mir_strcat(szClientBuf, ver);
@@ -943,7 +943,7 @@ const char* CIcqProto::detectUserClient( capstr *capId = MatchCapability(caps, wLen, &capMimPack, 4);
if (capId) {
char szPack[16];
- mir_snprintf(szPack, _countof(szPack), " [%.12s]", (*capId) + 4);
+ mir_snprintf(szPack, " [%.12s]", (*capId) + 4);
// make sure client string is not constant
if (szClient != szClientBuf) {
diff --git a/protocols/IcqOscarJ/src/icq_firstrun.cpp b/protocols/IcqOscarJ/src/icq_firstrun.cpp index 7570cb68fc..91a5de00f0 100644 --- a/protocols/IcqOscarJ/src/icq_firstrun.cpp +++ b/protocols/IcqOscarJ/src/icq_firstrun.cpp @@ -30,7 +30,7 @@ static void accountLoadDetails(CIcqProto *ppro, HWND hwndDlg) char pszUIN[20];
DWORD dwUIN = ppro->getContactUin(NULL);
if (dwUIN) {
- mir_snprintf(pszUIN, _countof(pszUIN), "%u", dwUIN);
+ mir_snprintf(pszUIN, "%u", dwUIN);
SetDlgItemTextA(hwndDlg, IDC_UIN, pszUIN);
}
diff --git a/protocols/IcqOscarJ/src/icq_http.cpp b/protocols/IcqOscarJ/src/icq_http.cpp index 6a46f8e35b..5c5492cbc3 100644 --- a/protocols/IcqOscarJ/src/icq_http.cpp +++ b/protocols/IcqOscarJ/src/icq_http.cpp @@ -54,7 +54,7 @@ int icq_httpGatewayInit(HANDLE hConn, NETLIBOPENCONNECTION*, NETLIBHTTPREQUEST * unpackDWord(&buf, &dwSid2);
unpackDWord(&buf, &dwSid3);
unpackDWord(&buf, &dwSid4);
- mir_snprintf(szSid, _countof(szSid), "%08x%08x%08x%08x", dwSid1, dwSid2, dwSid3, dwSid4);
+ mir_snprintf(szSid, "%08x%08x%08x%08x", dwSid1, dwSid2, dwSid3, dwSid4);
unpackWord(&buf, &wIpLen);
if(nlhr->dataLength < 30 + wIpLen || wIpLen == 0 || wIpLen > sizeof(szHttpServer) - 1)
@@ -73,8 +73,8 @@ int icq_httpGatewayInit(HANDLE hConn, NETLIBOPENCONNECTION*, NETLIBHTTPREQUEST * nlhpi.szHttpGetUrl = szHttpGetUrl;
nlhpi.szHttpPostUrl = szHttpPostUrl;
nlhpi.firstPostSequence = 1;
- mir_snprintf(szHttpGetUrl, _countof(szHttpGetUrl), "http://%s/monitor?sid=%s", szHttpServer, szSid);
- mir_snprintf(szHttpPostUrl, _countof(szHttpPostUrl), "http://%s/data?sid=%s&seq=", szHttpServer, szSid);
+ mir_snprintf(szHttpGetUrl, "http://%s/monitor?sid=%s", szHttpServer, szSid);
+ mir_snprintf(szHttpPostUrl, "http://%s/data?sid=%s&seq=", szHttpServer, szSid);
return CallService(MS_NETLIB_SETHTTPPROXYINFO, (WPARAM)hConn, (LPARAM)&nlhpi);
}
diff --git a/protocols/IcqOscarJ/src/icq_proto.cpp b/protocols/IcqOscarJ/src/icq_proto.cpp index f420108707..6f79e313c8 100644 --- a/protocols/IcqOscarJ/src/icq_proto.cpp +++ b/protocols/IcqOscarJ/src/icq_proto.cpp @@ -172,7 +172,7 @@ CIcqProto::CIcqProto(const char* aProtoName, const TCHAR* aUserName) : m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
char szP2PModuleName[MAX_PATH];
- mir_snprintf(szP2PModuleName, _countof(szP2PModuleName), "%sP2P", m_szModuleName);
+ mir_snprintf(szP2PModuleName, "%sP2P", m_szModuleName);
mir_sntprintf(szBuffer, TranslateT("%s client-to-client connections"), m_tszUserName);
nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_TCHAR;
nlu.ptszDescriptiveName = szBuffer;
@@ -241,9 +241,9 @@ int CIcqProto::OnModulesLoaded(WPARAM, LPARAM) char pszSrvGroupsName[MAX_PATH];
char* modules[5] = { 0, 0, 0, 0, 0 };
- mir_snprintf(pszP2PName, _countof(pszP2PName), "%sP2P", m_szModuleName);
- mir_snprintf(pszGroupsName, _countof(pszGroupsName), "%sGroups", m_szModuleName);
- mir_snprintf(pszSrvGroupsName, _countof(pszSrvGroupsName), "%sSrvGroups", m_szModuleName);
+ mir_snprintf(pszP2PName, "%sP2P", m_szModuleName);
+ mir_snprintf(pszGroupsName, "%sGroups", m_szModuleName);
+ mir_snprintf(pszSrvGroupsName, "%sSrvGroups", m_szModuleName);
modules[0] = m_szModuleName;
modules[1] = pszP2PName;
modules[2] = pszGroupsName;
@@ -1215,7 +1215,7 @@ HANDLE __cdecl CIcqProto::SendFile(MCONTACT hContact, const TCHAR* szDescription }
else {
char tmp[64];
- mir_snprintf(szFiles, _countof(szFiles), ICQTranslateUtfStatic("%d Files", tmp, _countof(tmp)), ft->dwFileCount);
+ mir_snprintf(szFiles, ICQTranslateUtfStatic("%d Files", tmp, _countof(tmp)), ft->dwFileCount);
pszFiles = szFiles;
}
@@ -1857,11 +1857,11 @@ int __cdecl CIcqProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM l case EV_PROTO_ONERASE:
{
char szDbSetting[MAX_PATH];
- mir_snprintf(szDbSetting, _countof(szDbSetting), "%sP2P", m_szModuleName);
+ mir_snprintf(szDbSetting, "%sP2P", m_szModuleName);
CallService(MS_DB_MODULE_DELETE, 0, (LPARAM)szDbSetting);
- mir_snprintf(szDbSetting, _countof(szDbSetting), "%sSrvGroups", m_szModuleName);
+ mir_snprintf(szDbSetting, "%sSrvGroups", m_szModuleName);
CallService(MS_DB_MODULE_DELETE, 0, (LPARAM)szDbSetting);
- mir_snprintf(szDbSetting, _countof(szDbSetting), "%sGroups", m_szModuleName);
+ mir_snprintf(szDbSetting, "%sGroups", m_szModuleName);
CallService(MS_DB_MODULE_DELETE, 0, (LPARAM)szDbSetting);
}
break;
diff --git a/protocols/IcqOscarJ/src/icq_servlist.cpp b/protocols/IcqOscarJ/src/icq_servlist.cpp index 3b7745d7d0..8f2b8ba7bb 100644 --- a/protocols/IcqOscarJ/src/icq_servlist.cpp +++ b/protocols/IcqOscarJ/src/icq_servlist.cpp @@ -850,7 +850,7 @@ void CIcqProto::LoadServerIDs() int nStart = nServerIDListCount;
char szModule[MAX_PATH];
- mir_snprintf(szModule, _countof(szModule), "%sSrvGroups", m_szModuleName);
+ mir_snprintf(szModule, "%sSrvGroups", m_szModuleName);
GroupReserveIdsEnumParam param = { this, szModule };
DBCONTACTENUMSETTINGS dbces = { 0 };
@@ -1178,7 +1178,7 @@ int CIcqProto::IsServerGroupsDefined() char szModule[MAX_PATH];
// flush obsolete linking data
- mir_snprintf(szModule, _countof(szModule), "%sGroups", m_szModuleName);
+ mir_snprintf(szModule, "%sGroups", m_szModuleName);
CallService(MS_DB_MODULE_DELETE, 0, (LPARAM)szModule);
iRes = 0; // no groups defined, or older version
@@ -1193,7 +1193,7 @@ void CIcqProto::FlushSrvGroupsCache() {
char szModule[MAX_PATH];
- mir_snprintf(szModule, _countof(szModule), "%sSrvGroups", m_szModuleName);
+ mir_snprintf(szModule, "%sSrvGroups", m_szModuleName);
CallService(MS_DB_MODULE_DELETE, 0, (LPARAM)szModule);
}
@@ -1273,7 +1273,7 @@ void CIcqProto::removeGroupPathLinks(WORD wGroupID) char szModule[MAX_PATH];
char* pars[3];
- mir_snprintf(szModule, _countof(szModule), "%sGroups", m_szModuleName);
+ mir_snprintf(szModule, "%sGroups", m_szModuleName);
pars[0] = NULL;
pars[1] = (char*)wGroupID;
@@ -1308,7 +1308,7 @@ char* CIcqProto::getServListGroupName(WORD wGroupID) return NULL;
}
- mir_snprintf(szModule, _countof(szModule), "%sSrvGroups", m_szModuleName);
+ mir_snprintf(szModule, "%sSrvGroups", m_szModuleName);
_itoa(wGroupID, szGroup, 0x10);
if (!CheckServerID(wGroupID, 0)) { // check if valid id, if not give empty and remove
@@ -1330,7 +1330,7 @@ void CIcqProto::setServListGroupName(WORD wGroupID, const char *szGroupName) return;
}
- mir_snprintf(szModule, _countof(szModule), "%sSrvGroups", m_szModuleName);
+ mir_snprintf(szModule, "%sSrvGroups", m_szModuleName);
_itoa(wGroupID, szGroup, 0x10);
if (szGroupName)
@@ -1344,7 +1344,7 @@ void CIcqProto::setServListGroupName(WORD wGroupID, const char *szGroupName) WORD CIcqProto::getServListGroupLinkID(const char *szPath)
{
char szModule[MAX_PATH];
- mir_snprintf(szModule, _countof(szModule), "%sGroups", m_szModuleName);
+ mir_snprintf(szModule, "%sGroups", m_szModuleName);
WORD wGroupId = db_get_w(NULL, szModule, szPath, 0);
@@ -1360,7 +1360,7 @@ WORD CIcqProto::getServListGroupLinkID(const char *szPath) void CIcqProto::setServListGroupLinkID(const char *szPath, WORD wGroupID)
{
char szModule[MAX_PATH];
- mir_snprintf(szModule, _countof(szModule), "%sGroups", m_szModuleName);
+ mir_snprintf(szModule, "%sGroups", m_szModuleName);
if (wGroupID)
db_set_w(NULL, szModule, szPath, wGroupID);
@@ -1530,7 +1530,7 @@ char* CIcqProto::getServListUniqueGroupName(const char *szGroupName, int bAlloce szGroupNameBase = null_strdup(szGroupName);
null_strcut(szGroupNameBase, m_wServerListRecordNameMaxLength);
- mir_snprintf(szModule, _countof(szModule), "%sSrvGroups", m_szModuleName);
+ mir_snprintf(szModule, "%sSrvGroups", m_szModuleName);
do {
pars[0] = (char*)this;
diff --git a/protocols/IcqOscarJ/src/icq_uploadui.cpp b/protocols/IcqOscarJ/src/icq_uploadui.cpp index 51b58641c9..a39ec5864f 100644 --- a/protocols/IcqOscarJ/src/icq_uploadui.cpp +++ b/protocols/IcqOscarJ/src/icq_uploadui.cpp @@ -155,7 +155,7 @@ static int GroupEnumIdsEnumProc(const char *szSetting,LPARAM lParam) static void enumServerGroups(CIcqProto* ppro)
{
char szModule[MAX_PATH+9];
- mir_snprintf(szModule, _countof(szModule), "%s%s", ppro->m_szModuleName, "SrvGroups");
+ mir_snprintf(szModule, "%s%s", ppro->m_szModuleName, "SrvGroups");
DBCONTACTENUMSETTINGS dbces = { 0 };
dbces.pfnEnumProc = &GroupEnumIdsEnumProc;
diff --git a/protocols/IcqOscarJ/src/icq_xstatus.cpp b/protocols/IcqOscarJ/src/icq_xstatus.cpp index e663d4ee38..251841a4c9 100644 --- a/protocols/IcqOscarJ/src/icq_xstatus.cpp +++ b/protocols/IcqOscarJ/src/icq_xstatus.cpp @@ -78,9 +78,11 @@ DWORD CIcqProto::requestXStatusDetails(MCONTACT hContact, BOOL bAllowDelay) if (!CheckContactCapabilities(hContact, CAPF_XTRAZ) && bAllowDelay)
return 0; // Contact does not support xtraz, do not request details
- struct rates_xstatus_request: public rates_queue_item {
+ struct rates_xstatus_request : public rates_queue_item
+ {
protected:
- virtual rates_queue_item* copyItem(rates_queue_item *aDest = NULL) {
+ virtual rates_queue_item* copyItem(rates_queue_item *aDest = NULL)
+ {
rates_xstatus_request *pDest = (rates_xstatus_request*)aDest;
if (!pDest)
pDest = new rates_xstatus_request(ppro, wGroup);
@@ -89,10 +91,11 @@ DWORD CIcqProto::requestXStatusDetails(MCONTACT hContact, BOOL bAllowDelay) return rates_queue_item::copyItem(pDest);
};
public:
- rates_xstatus_request(CIcqProto *ppro, WORD wGroup): rates_queue_item(ppro, wGroup) { };
- virtual ~rates_xstatus_request() { };
+ rates_xstatus_request(CIcqProto *ppro, WORD wGroup) : rates_queue_item(ppro, wGroup) {};
+ virtual ~rates_xstatus_request() {};
- virtual void execute() {
+ virtual void execute()
+ {
dwCookie = ppro->sendXStatusDetailsRequest(hContact, bForced);
};
@@ -136,7 +139,7 @@ static HANDLE LoadXStatusIconLibrary(TCHAR *path, const TCHAR *sub) static TCHAR* InitXStatusIconLibrary(TCHAR *buf, size_t buf_size)
{
- TCHAR path[2*MAX_PATH];
+ TCHAR path[2 * MAX_PATH];
HMODULE hXStatusIconsDLL;
// get miranda's exe path
@@ -150,7 +153,7 @@ static TCHAR* InitXStatusIconLibrary(TCHAR *buf, size_t buf_size) null_strcpy(buf, path, buf_size - 1);
char ident[MAX_PATH];
- if ( LoadStringA(hXStatusIconsDLL, IDS_IDENTIFY, ident, sizeof(ident)) == 0 || mir_strcmp(ident, "# Custom Status Icons #"))
+ if (LoadStringA(hXStatusIconsDLL, IDS_IDENTIFY, ident, sizeof(ident)) == 0 || mir_strcmp(ident, "# Custom Status Icons #"))
*buf = 0;
FreeLibrary(hXStatusIconsDLL);
@@ -165,14 +168,14 @@ HICON CIcqProto::getXStatusIcon(int bStatus, UINT flags) HICON icon = NULL;
if (bStatus > 0 && bStatus <= XSTATUS_COUNT)
- icon = IcoLib_GetIconByHandle(hXStatusIcons[bStatus-1], (flags & LR_BIGICON) != 0);
+ icon = IcoLib_GetIconByHandle(hXStatusIcons[bStatus - 1], (flags & LR_BIGICON) != 0);
return (flags & LR_SHARED || !icon) ? icon : CopyIcon(icon);
}
void setContactExtraIcon(MCONTACT hContact, int xstatus)
{
- ExtraIcon_SetIcon(hExtraXStatus, hContact, (xstatus > 0) ? hXStatusIcons[xstatus-1] : NULL);
+ ExtraIcon_SetIcon(hExtraXStatus, hContact, (xstatus > 0) ? hXStatusIcons[xstatus - 1] : NULL);
}
#define NULLCAP {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
@@ -207,7 +210,7 @@ capstr capXStatus[XSTATUS_COUNT] = { {0x16, 0x0C, 0x60, 0xBB, 0xDD, 0x44, 0x43, 0xF3, 0x91, 0x40, 0x05, 0x0F, 0x00, 0xE6, 0xC0, 0x09},
{0x64, 0x43, 0xC6, 0xAF, 0x22, 0x60, 0x45, 0x17, 0xB5, 0x8C, 0xD7, 0xDF, 0x8E, 0x29, 0x03, 0x52},
{0x16, 0xF5, 0xB7, 0x6F, 0xA9, 0xD2, 0x40, 0x35, 0x8C, 0xC5, 0xC0, 0x84, 0x70, 0x3C, 0x98, 0xFA},
- {0x63, 0x14, 0x36, 0xff, 0x3f, 0x8a, 0x40, 0xd0, 0xa5, 0xcb, 0x7b, 0x66, 0xe0, 0x51, 0xb3, 0x64},
+ {0x63, 0x14, 0x36, 0xff, 0x3f, 0x8a, 0x40, 0xd0, 0xa5, 0xcb, 0x7b, 0x66, 0xe0, 0x51, 0xb3, 0x64},
{0xb7, 0x08, 0x67, 0xf5, 0x38, 0x25, 0x43, 0x27, 0xa1, 0xff, 0xcf, 0x4c, 0xc1, 0x93, 0x97, 0x97},
{0xdd, 0xcf, 0x0e, 0xa9, 0x71, 0x95, 0x40, 0x48, 0xa9, 0xc6, 0x41, 0x32, 0x06, 0xd6, 0xf2, 0x80},
NULLCAP, NULLCAP, NULLCAP, NULLCAP, NULLCAP, NULLCAP, NULLCAP, NULLCAP, NULLCAP, NULLCAP,
@@ -215,7 +218,7 @@ capstr capXStatus[XSTATUS_COUNT] = { NULLCAP, NULLCAP, NULLCAP, NULLCAP, NULLCAP, NULLCAP, NULLCAP, NULLCAP, NULLCAP, NULLCAP,
NULLCAP, NULLCAP, NULLCAP, NULLCAP, NULLCAP, NULLCAP, NULLCAP, NULLCAP, NULLCAP, NULLCAP,
NULLCAP, NULLCAP, NULLCAP, NULLCAP, NULLCAP, NULLCAP, NULLCAP, NULLCAP, NULLCAP, NULLCAP,
- NULLCAP, NULLCAP, NULLCAP, NULLCAP};
+ NULLCAP, NULLCAP, NULLCAP, NULLCAP };
const char *nameXStatus[XSTATUS_COUNT] = {
LPGEN("Angry"), // 23
@@ -304,7 +307,7 @@ const char *nameXStatus[XSTATUS_COUNT] = { LPGEN("Sushi"), //79
LPGEN("Playing"), //81
LPGEN("Writing") //84
- };
+};
const int moodXStatus[XSTATUS_COUNT] = {
23,
@@ -392,7 +395,7 @@ const int moodXStatus[XSTATUS_COUNT] = { 78,
79,
81,
- 84};
+ 84 };
void CIcqProto::handleXStatusCaps(DWORD dwUIN, char *szUID, MCONTACT hContact, BYTE *caps, int capsize, char *moods, int moodsize)
{
@@ -406,40 +409,40 @@ void CIcqProto::handleXStatusCaps(DWORD dwUIN, char *szUID, MCONTACT hContact, B int nOldXStatusID = getContactXStatus(hContact);
if (m_bMoodsEnabled) {
- // process custom statuses (moods) from ICQ6
+ // process custom statuses (moods) from ICQ6
if (moods) {
if (moodsize > 0)
if (moodsize >= 32)
moods[32] = '\0';
- for (int i = 0; i < XSTATUS_COUNT; i++) {
- char szMoodId[32], szMoodData[32];
+ for (int i = 0; i < XSTATUS_COUNT; i++) {
+ char szMoodId[32], szMoodData[32];
- null_strcpy(szMoodData, moods, moodsize);
+ null_strcpy(szMoodData, moods, moodsize);
- if (moodXStatus[i] == -1) continue;
- mir_snprintf(szMoodId, _countof(szMoodId), "0icqmood%d", moodXStatus[i]);
- if (!mir_strcmp(szMoodId, szMoodData)) {
- BYTE bXStatusId = (BYTE)(i+1);
- char str[MAX_PATH];
+ if (moodXStatus[i] == -1) continue;
+ mir_snprintf(szMoodId, "0icqmood%d", moodXStatus[i]);
+ if (!mir_strcmp(szMoodId, szMoodData)) {
+ BYTE bXStatusId = (BYTE)(i + 1);
+ char str[MAX_PATH];
- SetContactCapabilities(hContact, CAPF_STATUS_MOOD);
+ SetContactCapabilities(hContact, CAPF_STATUS_MOOD);
- // only write default name when it is really needed, i.e. on Custom Status change
- if (nOldXStatusID != bXStatusId) {
- setByte(hContact, DBSETTING_XSTATUS_ID, bXStatusId);
- db_set_utf(hContact, m_szModuleName, DBSETTING_XSTATUS_NAME, ICQTranslateUtfStatic(nameXStatus[i], str, MAX_PATH));
- delSetting(hContact, DBSETTING_XSTATUS_MSG);
+ // only write default name when it is really needed, i.e. on Custom Status change
+ if (nOldXStatusID != bXStatusId) {
+ setByte(hContact, DBSETTING_XSTATUS_ID, bXStatusId);
+ db_set_utf(hContact, m_szModuleName, DBSETTING_XSTATUS_NAME, ICQTranslateUtfStatic(nameXStatus[i], str, MAX_PATH));
+ delSetting(hContact, DBSETTING_XSTATUS_MSG);
- debugLogA("%s changed mood to %s.", strUID(dwUIN, szUID), ICQTranslateUtfStatic(nameXStatus[i], str, MAX_PATH));
- bChanged = TRUE;
- }
+ debugLogA("%s changed mood to %s.", strUID(dwUIN, szUID), ICQTranslateUtfStatic(nameXStatus[i], str, MAX_PATH));
+ bChanged = TRUE;
+ }
- // cannot retrieve mood details here - need to be processed with new user details
- nMoodID = bXStatusId;
+ // cannot retrieve mood details here - need to be processed with new user details
+ nMoodID = bXStatusId;
- break;
- }
+ break;
+ }
}
if (nMoodID == 0 && moods)
@@ -448,17 +451,17 @@ void CIcqProto::handleXStatusCaps(DWORD dwUIN, char *szUID, MCONTACT hContact, B }
if (m_bXStatusEnabled) {
- // detect custom status capabilities
+ // detect custom status capabilities
if (caps) {
if (capsize > 0)
for (int i = 0; i < XSTATUS_COUNT; i++) {
if (MatchCapability(caps, capsize, (const capstr*)capXStatus[i], BINARY_CAP_SIZE)) {
- BYTE bXStatusId = (BYTE)(i+1);
+ BYTE bXStatusId = (BYTE)(i + 1);
char str[MAX_PATH];
SetContactCapabilities(hContact, CAPF_XSTATUS);
- // only write default name when it is really needed, i.e. on Custom Status change
+ // only write default name when it is really needed, i.e. on Custom Status change
if (nMoodID == 0 && nOldXStatusID != bXStatusId) {
setByte(hContact, DBSETTING_XSTATUS_ID, bXStatusId);
db_set_utf(hContact, m_szModuleName, DBSETTING_XSTATUS_NAME, ICQTranslateUtfStatic(nameXStatus[i], str, MAX_PATH));
@@ -509,8 +512,8 @@ void CIcqProto::updateServerCustomStatus(int fullUpdate) char szMoodData[32];
// prepare mood id
- if (m_bMoodsEnabled && bXStatus && moodXStatus[bXStatus-1] != -1)
- mir_snprintf(szMoodData, _countof(szMoodData), "0icqmood%d", moodXStatus[bXStatus-1]);
+ if (m_bMoodsEnabled && bXStatus && moodXStatus[bXStatus - 1] != -1)
+ mir_snprintf(szMoodData, "0icqmood%d", moodXStatus[bXStatus - 1]);
else
szMoodData[0] = '\0';
@@ -523,14 +526,14 @@ void CIcqProto::updateServerCustomStatus(int fullUpdate) if (bXStatus && (m_bXStatusEnabled || m_bMoodsEnabled))
szStatusNote = getSettingStringUtf(NULL, DBSETTING_XSTATUS_MSG, "");
// retrieve standard status message (e.g. custom status set to none)
- else {
+ else {
char **pszMsg = MirandaStatusToAwayMsg(m_iStatus);
{
mir_cslock l(m_modeMsgsMutex);
if (pszMsg)
szStatusNote = null_strdup(*pszMsg);
}
-
+
// no default status message, set empty
if (!szStatusNote)
szStatusNote = null_strdup("");
@@ -542,12 +545,12 @@ void CIcqProto::updateServerCustomStatus(int fullUpdate) SAFE_FREE(&szStatusNote);
}
-static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)
+static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- switch(msg) {
+ switch (msg) {
case WM_CHAR:
- if(wParam=='\n' && GetKeyState(VK_CONTROL) & 0x8000) {
- PostMessage(GetParent(hwnd),WM_COMMAND,IDOK,0);
+ if (wParam == '\n' && GetKeyState(VK_CONTROL) & 0x8000) {
+ PostMessage(GetParent(hwnd), WM_COMMAND, IDOK, 0);
return 0;
}
if (wParam == 1 && GetKeyState(VK_CONTROL) & 0x8000) { // ctrl-a
@@ -560,15 +563,15 @@ static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd,UINT msg,WPARAM wParam }
if (wParam == 127 && GetKeyState(VK_CONTROL) & 0x8000) { // ctrl-backspace
DWORD start, end;
- SendMessage(hwnd, EM_GETSEL, (WPARAM)&end, (LPARAM) (PDWORD) NULL);
+ SendMessage(hwnd, EM_GETSEL, (WPARAM)&end, (LPARAM)(PDWORD)NULL);
SendMessage(hwnd, WM_KEYDOWN, VK_LEFT, 0);
- SendMessage(hwnd, EM_GETSEL, (WPARAM)&start, (LPARAM) (PDWORD) NULL);
+ SendMessage(hwnd, EM_GETSEL, (WPARAM)&start, (LPARAM)(PDWORD)NULL);
WCHAR *text = GetWindowTextUcs(hwnd);
memmove(text + start, text + end, sizeof(WCHAR) * (mir_wstrlen(text) + 1 - end));
SetWindowTextUcs(hwnd, text);
SAFE_FREE(&text);
SendMessage(hwnd, EM_SETSEL, start, start);
- SendMessage(GetParent(hwnd), WM_COMMAND, MAKEWPARAM(GetDlgCtrlID(hwnd), EN_CHANGE), (LPARAM) hwnd);
+ SendMessage(GetParent(hwnd), WM_COMMAND, MAKEWPARAM(GetDlgCtrlID(hwnd), EN_CHANGE), (LPARAM)hwnd);
return 0;
}
break;
@@ -599,23 +602,23 @@ struct InitXStatusData };
#define HM_PROTOACK (WM_USER+10)
-static INT_PTR CALLBACK SetXStatusDlgProc(HWND hwndDlg,UINT message,WPARAM wParam,LPARAM lParam)
+static INT_PTR CALLBACK SetXStatusDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
SetXStatusData *dat = (SetXStatusData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
char str[MAX_PATH];
- switch(message) {
+ switch (message) {
case HM_PROTOACK:
{
ACKDATA *ack = (ACKDATA*)lParam;
- if (ack->type != ICQACKTYPE_XSTATUS_RESPONSE) break;
+ if (ack->type != ICQACKTYPE_XSTATUS_RESPONSE) break;
if (ack->hContact != dat->hContact) break;
if ((UINT_PTR)ack->hProcess != dat->iEvent) break;
ShowDlgItem(hwndDlg, IDC_RETRXSTATUS, SW_HIDE);
ShowDlgItem(hwndDlg, IDC_XMSG, SW_SHOW);
ShowDlgItem(hwndDlg, IDC_XTITLE, SW_SHOW);
- SetDlgItemText(hwndDlg,IDOK,TranslateT("Close"));
+ SetDlgItemText(hwndDlg, IDOK, TranslateT("Close"));
UnhookEvent(dat->hEvent); dat->hEvent = NULL;
char *szText = dat->ppro->getSettingStringUtf(dat->hContact, DBSETTING_XSTATUS_NAME, "");
SetDlgItemTextUtf(hwndDlg, IDC_XTITLE, szText);
@@ -633,18 +636,18 @@ static INT_PTR CALLBACK SetXStatusDlgProc(HWND hwndDlg,UINT message,WPARAM wPara TranslateDialogDefault(hwndDlg);
dat = (SetXStatusData*)SAFE_MALLOC(sizeof(SetXStatusData));
dat->ppro = init->ppro;
- SetWindowLongPtr(hwndDlg,GWLP_USERDATA,(LONG_PTR)dat);
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)dat);
dat->bAction = init->bAction;
if (!init->bAction) { // set our xStatus
dat->bXStatus = init->bXStatus;
SendDlgItemMessage(hwndDlg, IDC_XMSG, EM_LIMITTEXT, 1024, 0);
- mir_subclassWindow( GetDlgItem(hwndDlg,IDC_XMSG), MessageEditSubclassProc);
+ mir_subclassWindow(GetDlgItem(hwndDlg, IDC_XMSG), MessageEditSubclassProc);
SetDlgItemTextUtf(hwndDlg, IDC_XMSG, init->szXStatusMsg);
if (dat->ppro->m_bXStatusEnabled) { // custom status enabled, prepare title edit
SendDlgItemMessage(hwndDlg, IDC_XTITLE, EM_LIMITTEXT, 256, 0);
- mir_subclassWindow( GetDlgItem(hwndDlg,IDC_XTITLE), MessageEditSubclassProc);
+ mir_subclassWindow(GetDlgItem(hwndDlg, IDC_XTITLE), MessageEditSubclassProc);
SetDlgItemTextUtf(hwndDlg, IDC_XTITLE, init->szXStatusName);
}
else { // only moods enabled, hide title, resize message edit control
@@ -654,10 +657,10 @@ static INT_PTR CALLBACK SetXStatusDlgProc(HWND hwndDlg,UINT message,WPARAM wPara MoveDlgItem(hwndDlg, IDC_XMSG, 5, 9, 179, 65);
}
- dat->okButtonFormat = GetDlgItemTextUtf(hwndDlg,IDOK);
+ dat->okButtonFormat = GetDlgItemTextUtf(hwndDlg, IDOK);
dat->countdown = 5;
SendMessage(hwndDlg, WM_TIMER, 0, 0);
- SetTimer(hwndDlg,1,1000,0);
+ SetTimer(hwndDlg, 1, 1000, 0);
}
else { // retrieve contact's xStatus
dat->hContact = init->hContact;
@@ -667,7 +670,7 @@ static INT_PTR CALLBACK SetXStatusDlgProc(HWND hwndDlg,UINT message,WPARAM wPara SendDlgItemMessage(hwndDlg, IDC_XMSG, EM_SETREADONLY, 1, 0);
if (dat->ppro->CheckContactCapabilities(dat->hContact, CAPF_XSTATUS) && !dat->ppro->getByte("XStatusAuto", DEFAULT_XSTATUS_AUTO)) {
- SetDlgItemText(hwndDlg,IDOK,TranslateT("Cancel"));
+ SetDlgItemText(hwndDlg, IDOK, TranslateT("Cancel"));
dat->hEvent = HookEventMessage(ME_PROTO_ACK, hwndDlg, HM_PROTOACK);
ShowDlgItem(hwndDlg, IDC_RETRXSTATUS, SW_SHOW);
ShowDlgItem(hwndDlg, IDC_XMSG, SW_HIDE);
@@ -675,7 +678,7 @@ static INT_PTR CALLBACK SetXStatusDlgProc(HWND hwndDlg,UINT message,WPARAM wPara dat->iEvent = dat->ppro->requestXStatusDetails(dat->hContact, FALSE);
}
else {
- SetDlgItemText(hwndDlg,IDOK,TranslateT("Close"));
+ SetDlgItemText(hwndDlg, IDOK, TranslateT("Close"));
dat->hEvent = NULL;
char *szText = dat->ppro->getSettingStringUtf(dat->hContact, DBSETTING_XSTATUS_NAME, "");
SetDlgItemTextUtf(hwndDlg, IDC_XTITLE, szText);
@@ -698,41 +701,41 @@ static INT_PTR CALLBACK SetXStatusDlgProc(HWND hwndDlg,UINT message,WPARAM wPara }
if (dat->bXStatus) {
- SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)dat->ppro->getXStatusIcon(dat->bXStatus, LR_SHARED | LR_BIGICON));
+ SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)dat->ppro->getXStatusIcon(dat->bXStatus, LR_SHARED | LR_BIGICON));
SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)dat->ppro->getXStatusIcon(dat->bXStatus, LR_SHARED));
}
char buf[MAX_PATH];
char *format = GetWindowTextUtf(hwndDlg);
- mir_snprintf(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);
}
return TRUE;
case WM_TIMER:
- if(dat->countdown == -1) {
- DestroyWindow(hwndDlg);
+ if (dat->countdown == -1) {
+ DestroyWindow(hwndDlg);
break;
}
- mir_snprintf(str,_countof(str),dat->okButtonFormat,dat->countdown);
- SetDlgItemTextUtf(hwndDlg,IDOK,str);
+ mir_snprintf(str, dat->okButtonFormat, dat->countdown);
+ SetDlgItemTextUtf(hwndDlg, IDOK, str);
dat->countdown--;
break;
case WM_COMMAND:
- switch(LOWORD(wParam)) {
+ switch (LOWORD(wParam)) {
case IDOK:
DestroyWindow(hwndDlg);
break;
-
+
case IDC_XTITLE:
case IDC_XMSG:
if (!dat->bAction) { // set our xStatus
- KillTimer(hwndDlg,1);
- SetDlgItemText(hwndDlg,IDOK,TranslateT("OK"));
+ KillTimer(hwndDlg, 1);
+ SetDlgItemText(hwndDlg, IDOK, TranslateT("OK"));
}
}
break;
@@ -742,14 +745,14 @@ static INT_PTR CALLBACK SetXStatusDlgProc(HWND hwndDlg,UINT message,WPARAM wPara char szSetting[64];
dat->ppro->setByte(DBSETTING_XSTATUS_ID, dat->bXStatus);
- char *szValue = GetDlgItemTextUtf(hwndDlg,IDC_XMSG);
+ char *szValue = GetDlgItemTextUtf(hwndDlg, IDC_XMSG);
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);
+ szValue = GetDlgItemTextUtf(hwndDlg, IDC_XTITLE);
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);
@@ -793,7 +796,7 @@ void CIcqProto::setXStatusEx(BYTE bXStatus, BYTE bQuiet) if (m_bXStatusEnabled) {
mir_snprintf(szSetting, "XStatus%dName", bXStatus);
- szName = getSettingStringUtf(NULL, szSetting, ICQTranslateUtfStatic(nameXStatus[bXStatus-1], str, MAX_PATH));
+ szName = getSettingStringUtf(NULL, szSetting, ICQTranslateUtfStatic(nameXStatus[bXStatus - 1], str, MAX_PATH));
}
mir_snprintf(szSetting, "XStatus%dMsg", bXStatus);
szMsg = getSettingStringUtf(NULL, szSetting, "");
@@ -851,7 +854,7 @@ void CIcqProto::InitXStatusItems(BOOL bAllowStatus) HGENMENU hRoot;
{
TCHAR szItem[MAX_PATH + 64];
- mir_sntprintf(szItem, _countof(szItem), TranslateT("%s Custom Status"), m_tszUserName);
+ mir_sntprintf(szItem, TranslateT("%s Custom Status"), m_tszUserName);
CMenuItem mi;
mi.root = pcli->pfnGetProtocolMenu(m_szModuleName);
@@ -867,7 +870,7 @@ void CIcqProto::InitXStatusItems(BOOL bAllowStatus) int bXStatusMenuBuilt = 0;
for (int i = 0; i <= XSTATUS_COUNT; i++) {
char srvFce[MAX_PATH + 64];
- mir_snprintf(srvFce, _countof(srvFce), "/menuXStatus%d", i);
+ mir_snprintf(srvFce, "/menuXStatus%d", i);
mi.position++;
if (!i)
@@ -877,8 +880,8 @@ void CIcqProto::InitXStatusItems(BOOL bAllowStatus) CreateProtoServiceParam(srvFce, &CIcqProto::menuXStatus, i);
mi.flags = (bXStatus == i ? CMIF_CHECKED : 0);
- mi.hIcolibItem = i ? hXStatusIcons[i-1] : NULL;
- mi.name.a = i ? (char*)nameXStatus[i-1] : (char *)LPGEN("None");
+ mi.hIcolibItem = i ? hXStatusIcons[i - 1] : NULL;
+ mi.name.a = i ? (char*)nameXStatus[i - 1] : (char *)LPGEN("None");
mi.pszService = srvFce;
hXStatusItems[i] = Menu_AddStatusMenuItem(&mi, m_szModuleName);
@@ -888,7 +891,7 @@ void CIcqProto::InitXStatusItems(BOOL bAllowStatus) void InitXStatusIcons()
{
- TCHAR lib[2*MAX_PATH] = {0};
+ TCHAR lib[2 * MAX_PATH] = { 0 };
SKINICONDESC sid = { 0 };
sid.section.a = "Protocols/" ICQ_PROTOCOL_NAME "/" LPGEN("Custom Status");
@@ -900,7 +903,7 @@ void InitXStatusIcons() mir_snprintf(szTemp, "icq_xstatus%d", i);
sid.pszName = szTemp;
sid.description.a = (LPSTR)nameXStatus[i];
- sid.iDefaultIndex = -(IDI_XSTATUS1+i);
+ sid.iDefaultIndex = -(IDI_XSTATUS1 + i);
hXStatusIcons[i] = IcoLib_AddIcon(&sid);
}
@@ -982,7 +985,7 @@ INT_PTR CIcqProto::GetXStatusEx(WPARAM hContact, LPARAM lParam) // fill status member
if (pData->flags & CSSF_MASK_STATUS)
*pData->status = getContactXStatus(hContact);
-
+
// fill status name member
if (pData->flags & CSSF_MASK_NAME) {
if (pData->flags & CSSF_DEFAULT_NAME) {
@@ -991,10 +994,10 @@ INT_PTR CIcqProto::GetXStatusEx(WPARAM hContact, LPARAM lParam) return 1; // Failure
if (pData->flags & CSSF_UNICODE) {
- char *text = (char*)nameXStatus[status-1];
+ char *text = (char*)nameXStatus[status - 1];
MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, text, -1, pData->pwszName, MAX_PATH);
}
- else mir_strcpy(pData->pszName, (char*)nameXStatus[status-1]);
+ else mir_strcpy(pData->pszName, (char*)nameXStatus[status - 1]);
}
else { // moods does not support status title
if (!m_bXStatusEnabled) return 1;
@@ -1009,7 +1012,7 @@ INT_PTR CIcqProto::GetXStatusEx(WPARAM hContact, LPARAM lParam) }
else {
DBVARIANT dbv;
- if ( !getString(hContact, DBSETTING_XSTATUS_NAME, &dbv) && dbv.pszVal) {
+ if (!getString(hContact, DBSETTING_XSTATUS_NAME, &dbv) && dbv.pszVal) {
mir_strcpy(pData->pszName, dbv.pszVal);
db_free(&dbv);
}
@@ -1028,7 +1031,7 @@ INT_PTR CIcqProto::GetXStatusEx(WPARAM hContact, LPARAM lParam) SAFE_FREE(&wstr);
}
else {
- DBVARIANT dbv = {0};
+ DBVARIANT dbv = { 0 };
if (!getString(hContact, CheckContactCapabilities(hContact, CAPF_STATUS_MOOD) ? DBSETTING_STATUS_NOTE : DBSETTING_XSTATUS_MSG, &dbv) && dbv.pszVal)
mir_strcpy(pData->pszMessage, dbv.pszVal);
@@ -1052,7 +1055,7 @@ INT_PTR CIcqProto::GetXStatusEx(WPARAM hContact, LPARAM lParam) *pData->wParam = XSTATUS_COUNT;
if (pData->flags & CSSF_STR_SIZES) {
- DBVARIANT dbv = {DBVT_DELETED};
+ DBVARIANT dbv = { DBVT_DELETED };
if (pData->wParam) {
if (m_bXStatusEnabled && !getString(hContact, DBSETTING_XSTATUS_NAME, &dbv))
@@ -1107,24 +1110,24 @@ INT_PTR CIcqProto::RequestAdvStatusIconIdx(WPARAM wParam, LPARAM) BYTE bXStatus = getContactXStatus(wParam);
if (bXStatus) {
- if (!bXStatusCListIconsValid[bXStatus-1]) { // adding icon
- int idx = hXStatusCListIcons[bXStatus-1];
- HIMAGELIST hCListImageList = (HIMAGELIST)CallService(MS_CLIST_GETICONSIMAGELIST,0,0);
+ if (!bXStatusCListIconsValid[bXStatus - 1]) { // adding icon
+ int idx = hXStatusCListIcons[bXStatus - 1];
+ HIMAGELIST hCListImageList = (HIMAGELIST)CallService(MS_CLIST_GETICONSIMAGELIST, 0, 0);
if (hCListImageList) {
HICON hXStatusIcon = getXStatusIcon(bXStatus, LR_SHARED);
if (idx > 0)
ImageList_ReplaceIcon(hCListImageList, idx, hXStatusIcon);
else
- hXStatusCListIcons[bXStatus-1] = ImageList_AddIcon(hCListImageList, hXStatusIcon);
+ hXStatusCListIcons[bXStatus - 1] = ImageList_AddIcon(hCListImageList, hXStatusIcon);
// mark icon index in the array as valid
- bXStatusCListIconsValid[bXStatus-1] = TRUE;
+ bXStatusCListIconsValid[bXStatus - 1] = TRUE;
IcoLib_ReleaseIcon(hXStatusIcon);
- }
+ }
}
- int idx = bXStatusCListIconsValid[bXStatus-1] ? hXStatusCListIcons[bXStatus-1] : -1;
+ int idx = bXStatusCListIconsValid[bXStatus - 1] ? hXStatusCListIcons[bXStatus - 1] : -1;
if (idx > 0)
return (idx & 0xFFFF) << 16;
}
diff --git a/protocols/IcqOscarJ/src/log.cpp b/protocols/IcqOscarJ/src/log.cpp index 644fef9e5c..04709b2579 100644 --- a/protocols/IcqOscarJ/src/log.cpp +++ b/protocols/IcqOscarJ/src/log.cpp @@ -126,7 +126,7 @@ void CIcqProto::icq_LogUsingErrorCode(int level, DWORD dwError, const char *szMs break;
}
- mir_snprintf(szBuf, _countof(szBuf), "%s%s%s (%s %d)",
+ mir_snprintf(szBuf, "%s%s%s (%s %d)",
szMsg ? ICQTranslateUtfStatic(szMsg, str, 1024) : "",
szMsg ? "\r\n\r\n" : "",
ICQTranslateUtfStatic(pszErrorMsg, szErrorMsg, 512),
diff --git a/protocols/IcqOscarJ/src/loginpassword.cpp b/protocols/IcqOscarJ/src/loginpassword.cpp index 2b19ad07eb..81ea3741ed 100644 --- a/protocols/IcqOscarJ/src/loginpassword.cpp +++ b/protocols/IcqOscarJ/src/loginpassword.cpp @@ -42,7 +42,7 @@ INT_PTR CALLBACK LoginPasswdDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA DWORD dwUin = ppro->getContactUin(NULL);
TCHAR pszUIN[MAX_PATH];
- mir_sntprintf(pszUIN, _countof(pszUIN), TranslateT("Enter a password for UIN %u:"), dwUin);
+ mir_sntprintf(pszUIN, TranslateT("Enter a password for UIN %u:"), dwUin);
SetDlgItemText(hwndDlg, IDC_INSTRUCTION, pszUIN);
SendDlgItemMessage(hwndDlg, IDC_LOGINPW, EM_LIMITTEXT, PASSWORDMAXLEN - 1, 0);
diff --git a/protocols/IcqOscarJ/src/oscar_filetransfer.cpp b/protocols/IcqOscarJ/src/oscar_filetransfer.cpp index d378d71dba..4367dadc88 100644 --- a/protocols/IcqOscarJ/src/oscar_filetransfer.cpp +++ b/protocols/IcqOscarJ/src/oscar_filetransfer.cpp @@ -1586,7 +1586,7 @@ int CIcqProto::oft_handleFileData(oscar_connection *oc, BYTE *buf, size_t len) char *pszMsg = ICQTranslateUtf(LPGEN("The checksum of file \"%s\" does not match, the file is probably damaged."));
char szBuf[MAX_PATH];
- mir_snprintf(szBuf, _countof(szBuf), pszMsg, ExtractFileName(ft->szThisFile));
+ mir_snprintf(szBuf, pszMsg, ExtractFileName(ft->szThisFile));
icq_LogMessage(LOG_ERROR, szBuf);
SAFE_FREE(&pszMsg);
diff --git a/protocols/JabberG/src/jabber_console.cpp b/protocols/JabberG/src/jabber_console.cpp index 15a5048d18..c0974eba95 100644 --- a/protocols/JabberG/src/jabber_console.cpp +++ b/protocols/JabberG/src/jabber_console.cpp @@ -194,7 +194,7 @@ static void sttEmptyBuf(StringBuf *buf) static void sttRtfAppendXml(StringBuf *buf, HXML node, DWORD flags, int indent)
{
char indentLevel[128];
- mir_snprintf(indentLevel, _countof(indentLevel), RTF_INDENT_FMT, (int)(indent*200));
+ mir_snprintf(indentLevel, RTF_INDENT_FMT, (int)(indent*200));
sttAppendBufRaw(buf, RTF_BEGINTAG);
sttAppendBufRaw(buf, indentLevel);
@@ -228,7 +228,7 @@ static void sttRtfAppendXml(StringBuf *buf, HXML node, DWORD flags, int indent) if (XmlGetChildCount(node)) {
sttAppendBufRaw(buf, RTF_BEGINTEXT);
char indentTextLevel[128];
- mir_snprintf(indentTextLevel, _countof(indentTextLevel), RTF_TEXTINDENT_FMT, (int)((indent + 1) * 200));
+ mir_snprintf(indentTextLevel, RTF_TEXTINDENT_FMT, (int)((indent + 1) * 200));
sttAppendBufRaw(buf, indentTextLevel);
}
diff --git a/protocols/JabberG/src/jabber_file.cpp b/protocols/JabberG/src/jabber_file.cpp index 6a00da7d80..6f448c2bab 100644 --- a/protocols/JabberG/src/jabber_file.cpp +++ b/protocols/JabberG/src/jabber_file.cpp @@ -288,7 +288,7 @@ void __cdecl CJabberProto::FileServerThread(filetransfer *ft) myAddr = (char*)CallService(MS_NETLIB_ADDRESSTOSTRING, 1, nlb.dwExternalIP);
char szAddr[256];
- mir_snprintf(szAddr, _countof(szAddr), "http://%s:%d/%s", myAddr, nlb.wPort, pFileName);
+ mir_snprintf(szAddr, "http://%s:%d/%s", myAddr, nlb.wPort, pFileName);
size_t len = mir_tstrlen(ptszResource) + mir_tstrlen(ft->jid) + 2;
TCHAR *fulljid = (TCHAR *)alloca(sizeof(TCHAR) * len);
@@ -403,7 +403,7 @@ int CJabberProto::FileSendParse(JABBER_SOCKET s, filetransfer *ft, char* buffer, }
char fileBuffer[2048];
- int bytes = mir_snprintf(fileBuffer, _countof(fileBuffer), "HTTP/1.1 200 OK\r\nContent-Length: %I64u\r\n\r\n", statbuf.st_size);
+ int bytes = mir_snprintf(fileBuffer, "HTTP/1.1 200 OK\r\nContent-Length: %I64u\r\n\r\n", statbuf.st_size);
WsSend(s, fileBuffer, bytes, MSG_DUMPASTEXT);
ft->std.flags |= PFTS_SENDING;
diff --git a/protocols/JabberG/src/jabber_icolib.cpp b/protocols/JabberG/src/jabber_icolib.cpp index ebca9d50dd..0008e5443e 100644 --- a/protocols/JabberG/src/jabber_icolib.cpp +++ b/protocols/JabberG/src/jabber_icolib.cpp @@ -113,7 +113,7 @@ CIconPool::~CIconPool() void CIconPool::RegisterIcon(const char *name, TCHAR *filename, int iconid, TCHAR *szSection, TCHAR *szDescription)
{
char szSettingName[128];
- mir_snprintf(szSettingName, _countof(szSettingName), "jabber_%s", name);
+ mir_snprintf(szSettingName, "jabber_%s", name);
CPoolItem *item = new CPoolItem;
item->m_name = mir_strdup(name);
@@ -278,8 +278,8 @@ static HICON LoadTransportIcon(char *filename, int i, char *IconName, TCHAR *Sec GetModuleFileNameA(NULL, szPath, MAX_PATH);
str = strrchr(szPath, '\\');
if (str != NULL) *str = 0;
- mir_snprintf(szMyPath, _countof(szMyPath), "%s\\Icons\\%s", szPath, filename);
- mir_snprintf(szFullPath, _countof(szFullPath), "%s\\Icons\\%s,%d", szPath, filename, i);
+ mir_snprintf(szMyPath, "%s\\Icons\\%s", szPath, filename);
+ mir_snprintf(szFullPath, "%s\\Icons\\%s,%d", szPath, filename, i);
BOOL nf;
HICON hi = ExtractIconFromPath(szFullPath, &nf);
if (hi) has_proto_icon = TRUE;
@@ -317,7 +317,7 @@ int CJabberProto::LoadAdvancedIcons(int iID) BOOL needFree;
int n = skinStatusToJabberStatus[i];
TCHAR *descr = pcli->pfnGetStatusModeDescription(n + ID_STATUS_OFFLINE, 0);
- mir_snprintf(Uname, _countof(Uname), "%s_Transport_%s_%d", m_szModuleName, proto, n);
+ mir_snprintf(Uname, "%s_Transport_%s_%d", m_szModuleName, proto, n);
HICON hicon = LoadTransportIcon(defFile, -skinIconStatusToResourceId[i], Uname, Group, descr, -(n + ID_STATUS_OFFLINE), &needFree);
int index = (m_transportProtoTableStartIndex[iID] == -1) ? -1 : m_transportProtoTableStartIndex[iID] + n;
int added = ImageList_ReplaceIcon(hAdvancedStatusIcon, index, hicon ? hicon : empty);
@@ -548,7 +548,7 @@ HANDLE g_GetIconHandle(int iconId) HICON g_LoadIconEx(const char* name, bool big)
{
char szSettingName[100];
- mir_snprintf(szSettingName, _countof(szSettingName), "%s_%s", GLOBAL_SETTING_PREFIX, name);
+ mir_snprintf(szSettingName, "%s_%s", GLOBAL_SETTING_PREFIX, name);
return IcoLib_GetIcon(szSettingName, big);
}
diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp index 5c55583396..475e14a7f3 100644 --- a/protocols/JabberG/src/jabber_iqid.cpp +++ b/protocols/JabberG/src/jabber_iqid.cpp @@ -219,7 +219,7 @@ void CJabberProto::OnIqResultGetAuth(HXML iqNode, CJabberIqInfo*) JabberShaStrBuf buf;
T2Utf str(m_ThreadInfo->conn.password);
char text[200];
- mir_snprintf(text, _countof(text), "%s%s", m_ThreadInfo->szStreamId, str);
+ mir_snprintf(text, "%s%s", m_ThreadInfo->szStreamId, str);
query << XCHILD(_T("digest"), _A2T(JabberSha1(text, buf)));
}
else if (XmlGetChild(queryNode, "password") != NULL)
@@ -751,13 +751,13 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*) if (nEmail == 0)
mir_strcpy(text, "e-mail");
else
- mir_snprintf(text, _countof(text), "e-mail%d", nEmail - 1);
+ mir_snprintf(text, "e-mail%d", nEmail - 1);
}
- else mir_snprintf(text, _countof(text), "e-mail%d", nEmail);
+ else mir_snprintf(text, "e-mail%d", nEmail);
setTString(hContact, text, XmlGetText(m));
if (hContact == NULL) {
- mir_snprintf(text, _countof(text), "e-mailFlag%d", nEmail);
+ mir_snprintf(text, "e-mailFlag%d", nEmail);
int nFlag = 0;
if (XmlGetChild(n, "HOME") != NULL) nFlag |= JABBER_VCEMAIL_HOME;
if (XmlGetChild(n, "WORK") != NULL) nFlag |= JABBER_VCEMAIL_WORK;
@@ -925,10 +925,10 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*) }
else {
char text[100];
- mir_snprintf(text, _countof(text), "Phone%d", nPhone);
+ mir_snprintf(text, "Phone%d", nPhone);
setTString(text, XmlGetText(m));
- mir_snprintf(text, _countof(text), "PhoneFlag%d", nPhone);
+ mir_snprintf(text, "PhoneFlag%d", nPhone);
int nFlag = 0;
if (XmlGetChild(n, "HOME") != NULL) nFlag |= JABBER_VCTEL_HOME;
if (XmlGetChild(n, "WORK") != NULL) nFlag |= JABBER_VCTEL_WORK;
@@ -1013,7 +1013,7 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*) delSetting(hContact, "e-mail");
else {
char text[100];
- mir_snprintf(text, _countof(text), "e-mail%d", nEmail - 1);
+ mir_snprintf(text, "e-mail%d", nEmail - 1);
if (db_get_s(hContact, m_szModuleName, text, &dbv)) break;
db_free(&dbv);
delSetting(hContact, text);
@@ -1024,11 +1024,11 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*) else {
while (true) {
char text[100];
- mir_snprintf(text, _countof(text), "e-mail%d", nEmail);
+ mir_snprintf(text, "e-mail%d", nEmail);
if (getString(text, &dbv)) break;
db_free(&dbv);
delSetting(text);
- mir_snprintf(text, _countof(text), "e-mailFlag%d", nEmail);
+ mir_snprintf(text, "e-mailFlag%d", nEmail);
delSetting(text);
nEmail++;
}
@@ -1058,11 +1058,11 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*) else {
while (true) {
char text[100];
- mir_snprintf(text, _countof(text), "Phone%d", nPhone);
+ mir_snprintf(text, "Phone%d", nPhone);
if (getString(text, &dbv)) break;
db_free(&dbv);
delSetting(text);
- mir_snprintf(text, _countof(text), "PhoneFlag%d", nPhone);
+ mir_snprintf(text, "PhoneFlag%d", nPhone);
delSetting(text);
nPhone++;
}
diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp index ba19e2ef1e..2ac9597335 100644 --- a/protocols/JabberG/src/jabber_menu.cpp +++ b/protocols/JabberG/src/jabber_menu.cpp @@ -424,7 +424,7 @@ int CJabberProto::OnPrebuildContactMenu(WPARAM hContact, LPARAM) CMString szTmp;
for (int i = 0; i < nMenuResourceItemsNew; i++) {
- mir_snprintf(text, _countof(text), "/UseResource_%d", i);
+ mir_snprintf(text, "/UseResource_%d", i);
if (i >= m_nMenuResourceItems) {
CreateProtoServiceParam(text, &CJabberProto::OnMenuHandleResource, MENUITEM_RESOURCES + i);
mi.name.a = "";
@@ -690,7 +690,7 @@ void CJabberProto::MenuInit() mi.flags = CMIF_UNMOVABLE | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
mi.root = m_hMenuPriorityRoot;
- mir_snprintf(srvFce, _countof(srvFce), "/menuSetPriority/%d", 0);
+ mir_snprintf(srvFce, "/menuSetPriority/%d", 0);
bool needServices = !ProtoServiceExists(m_szModuleName, srvFce);
if (needServices)
CreateProtoServiceParam(srvFce, &CJabberProto::OnMenuSetPriority, 0);
@@ -702,7 +702,7 @@ void CJabberProto::MenuInit() continue;
}
- mir_snprintf(srvFce, _countof(srvFce), "/menuSetPriority/%d", steps[i]);
+ mir_snprintf(srvFce, "/menuSetPriority/%d", steps[i]);
if (steps[i] > 0) {
mir_sntprintf(szName, TranslateT("Increase priority by %d"), steps[i]);
mi.hIcolibItem = GetIconHandle(IDI_ARROW_UP);
diff --git a/protocols/JabberG/src/jabber_privacy.cpp b/protocols/JabberG/src/jabber_privacy.cpp index 13fe033689..5f9a47bfdb 100644 --- a/protocols/JabberG/src/jabber_privacy.cpp +++ b/protocols/JabberG/src/jabber_privacy.cpp @@ -2127,7 +2127,7 @@ void CJabberProto::BuildPrivacyListsMenu(bool bDeleteOld) mi.pszService = srvFce;
int i = 0;
- mir_snprintf(srvFce, _countof(srvFce), "/menuPrivacy%d", i);
+ mir_snprintf(srvFce, "/menuPrivacy%d", i);
if (i > m_privacyMenuServiceAllocated) {
CreateProtoServiceParam(srvFce, &CJabberProto::menuSetPrivacyList, i);
m_privacyMenuServiceAllocated = i;
@@ -2139,7 +2139,7 @@ void CJabberProto::BuildPrivacyListsMenu(bool bDeleteOld) for (CPrivacyList *pList = m_privacyListManager.GetFirstList(); pList; pList = pList->GetNext()) {
i++;
- mir_snprintf(srvFce, _countof(srvFce), "/menuPrivacy%d", i);
+ mir_snprintf(srvFce, "/menuPrivacy%d", i);
if (i > m_privacyMenuServiceAllocated) {
CreateProtoServiceParam(srvFce, &CJabberProto::menuSetPrivacyList, i);
diff --git a/protocols/JabberG/src/jabber_search.cpp b/protocols/JabberG/src/jabber_search.cpp index d05e00da66..ee1c82d201 100644 --- a/protocols/JabberG/src/jabber_search.cpp +++ b/protocols/JabberG/src/jabber_search.cpp @@ -493,21 +493,21 @@ void CJabberProto::SearchDeleteFromRecent(const TCHAR *szAddr, BOOL deleteLastFr //search in recent for (int i = 0; i < 10; i++) { char key[30]; - mir_snprintf(key, _countof(key), "RecentlySearched_%d", i); + mir_snprintf(key, "RecentlySearched_%d", i); ptrT szValue(getTStringA(key)); if (szValue == NULL || mir_tstrcmpi(szAddr, szValue)) continue; for (int j = i; j < 10; j++) { - mir_snprintf(key, _countof(key), "RecentlySearched_%d", j + 1); + mir_snprintf(key, "RecentlySearched_%d", j + 1); szValue = getTStringA(key); if (szValue != NULL) { - mir_snprintf(key, _countof(key), "RecentlySearched_%d", j); + mir_snprintf(key, "RecentlySearched_%d", j); setTString(NULL, key, szValue); } else { if (deleteLastFromDB) { - mir_snprintf(key, _countof(key), "RecentlySearched_%d", j); + mir_snprintf(key, "RecentlySearched_%d", j); delSetting(NULL, key); } break; @@ -523,15 +523,15 @@ void CJabberProto::SearchAddToRecent(const TCHAR *szAddr, HWND hwndDialog) SearchDeleteFromRecent(szAddr); for (int j = 9; j > 0; j--) { - mir_snprintf(key, _countof(key), "RecentlySearched_%d", j - 1); + mir_snprintf(key, "RecentlySearched_%d", j - 1); ptrT szValue(getTStringA(key)); if (szValue != NULL) { - mir_snprintf(key, _countof(key), "RecentlySearched_%d", j); + mir_snprintf(key, "RecentlySearched_%d", j); setTString(NULL, key, szValue); } } - mir_snprintf(key, _countof(key), "RecentlySearched_%d", 0); + mir_snprintf(key, "RecentlySearched_%d", 0); setTString(key, szAddr); if (hwndDialog) JabberSearchAddUrlToRecentCombo(hwndDialog, szAddr); @@ -563,7 +563,7 @@ static INT_PTR CALLBACK JabberSearchAdvancedDlgProc(HWND hwndDlg, UINT msg, WPAR for (i = 0; i < 10; i++) { char key[30]; - mir_snprintf(key, _countof(key), "RecentlySearched_%d", i); + mir_snprintf(key, "RecentlySearched_%d", i); ptrT szValue(dat->ppro->getTStringA(key)); if (szValue != NULL) JabberSearchAddUrlToRecentCombo(hwndDlg, szValue); diff --git a/protocols/JabberG/src/jabber_secur.cpp b/protocols/JabberG/src/jabber_secur.cpp index 9edeb32d7e..cf0e6089cf 100644 --- a/protocols/JabberG/src/jabber_secur.cpp +++ b/protocols/JabberG/src/jabber_secur.cpp @@ -155,7 +155,7 @@ char* TMD5Auth::getChallenge(const TCHAR *challenge) mir_md5_state_t ctx;
Utils_GetRandom(digest, sizeof(digest));
- mir_snprintf(cnonce, _countof(cnonce), "%08x%08x%08x%08x", htonl(digest[0]), htonl(digest[1]), htonl(digest[2]), htonl(digest[3]));
+ mir_snprintf(cnonce, "%08x%08x%08x%08x", htonl(digest[0]), htonl(digest[1]), htonl(digest[2]), htonl(digest[3]));
T2Utf uname(info->conn.username), passw(info->conn.password);
ptrA serv(mir_utf8encode(info->conn.server));
@@ -182,15 +182,15 @@ char* TMD5Auth::getChallenge(const TCHAR *challenge) mir_md5_finish(&ctx, (BYTE*)hash2);
mir_md5_init(&ctx);
- mir_snprintf(tmpBuf, _countof(tmpBuf), "%08x%08x%08x%08x", htonl(hash1[0]), htonl(hash1[1]), htonl(hash1[2]), htonl(hash1[3]));
+ mir_snprintf(tmpBuf, "%08x%08x%08x%08x", htonl(hash1[0]), htonl(hash1[1]), htonl(hash1[2]), htonl(hash1[3]));
mir_md5_append(&ctx, (BYTE*)tmpBuf, (int)mir_strlen(tmpBuf));
mir_md5_append(&ctx, (BYTE*)":", 1);
mir_md5_append(&ctx, (BYTE*)nonce, (int)mir_strlen(nonce));
- mir_snprintf(tmpBuf, _countof(tmpBuf), ":%08d:", iCallCount);
+ mir_snprintf(tmpBuf, ":%08d:", iCallCount);
mir_md5_append(&ctx, (BYTE*)tmpBuf, (int)mir_strlen(tmpBuf));
mir_md5_append(&ctx, (BYTE*)cnonce, (int)mir_strlen(cnonce));
mir_md5_append(&ctx, (BYTE*)":auth:", 6);
- mir_snprintf(tmpBuf, _countof(tmpBuf), "%08x%08x%08x%08x", htonl(hash2[0]), htonl(hash2[1]), htonl(hash2[2]), htonl(hash2[3]));
+ mir_snprintf(tmpBuf, "%08x%08x%08x%08x", htonl(hash2[0]), htonl(hash2[1]), htonl(hash2[2]), htonl(hash2[3]));
mir_md5_append(&ctx, (BYTE*)tmpBuf, (int)mir_strlen(tmpBuf));
mir_md5_finish(&ctx, (BYTE*)digest);
@@ -278,7 +278,7 @@ char* TScramAuth::getChallenge(const TCHAR *challenge) mir_sha1_finish(&ctx, storedKey);
char authmsg[4096];
- int authmsgLen = mir_snprintf(authmsg, _countof(authmsg), "%s,%s,c=biws,r=%s", msg1, chl, snonce);
+ int authmsgLen = mir_snprintf(authmsg, "%s,%s,c=biws,r=%s", msg1, chl, snonce);
BYTE clientSig[MIR_SHA1_HASH_SIZE];
mir_hmac_sha1(clientSig, storedKey, sizeof(storedKey), (BYTE*)authmsg, authmsgLen);
diff --git a/protocols/JabberG/src/jabber_std.cpp b/protocols/JabberG/src/jabber_std.cpp index e911f2a2c9..ef5cb2a80c 100644 --- a/protocols/JabberG/src/jabber_std.cpp +++ b/protocols/JabberG/src/jabber_std.cpp @@ -72,17 +72,17 @@ void CJabberProto::ConvertPasswords() for (int i = 0;; i++) {
char varName[100];
- mir_snprintf(varName, _countof(varName), "rcMuc_%d_server", i);
+ mir_snprintf(varName, "rcMuc_%d_server", i);
ptrA str(getStringA(NULL, varName));
if (str == NULL)
break;
- mir_snprintf(varName, _countof(varName), "rcMuc_%d", i);
+ mir_snprintf(varName, "rcMuc_%d", i);
passw = JSetStringCrypt(m_szModuleName, NULL, varName);
if (passw != NULL) {
delSetting(varName);
- mir_snprintf(varName, _countof(varName), "password_rcMuc_%d", i);
+ mir_snprintf(varName, "password_rcMuc_%d", i);
setTString(varName, passw);
}
}
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index 31bb9c7241..9122ce016d 100644 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -148,7 +148,7 @@ void ThreadData::xmpp_client_query(void) return;
char temp[256];
- mir_snprintf(temp, _countof(temp), "_xmpp-client._tcp.%s", conn.server);
+ mir_snprintf(temp, "_xmpp-client._tcp.%s", conn.server);
DNS_RECORDA *results = NULL;
DNS_STATUS status = DnsQuery_A(temp, DNS_TYPE_SRV, DNS_QUERY_STANDARD, NULL, (PDNS_RECORD *)&results, NULL);
diff --git a/protocols/JabberG/src/jabber_xstatus.cpp b/protocols/JabberG/src/jabber_xstatus.cpp index 1837898e5c..42d77dd05c 100644 --- a/protocols/JabberG/src/jabber_xstatus.cpp +++ b/protocols/JabberG/src/jabber_xstatus.cpp @@ -1221,7 +1221,7 @@ void CJabberProto::SetContactTune(MCONTACT hContact, LPCTSTR szArtist, LPCTSTR s setTString(hContact, "ListeningTo", szListeningTo);
char tuneIcon[128];
- mir_snprintf(tuneIcon, _countof(tuneIcon), "%s_%s", m_szModuleName, "main");
+ mir_snprintf(tuneIcon, "%s_%s", m_szModuleName, "main");
WriteAdvStatus(hContact, ADVSTATUS_TUNE, _T("listening_to"), tuneIcon, TranslateT("Listening To"), szListeningTo);
mir_free(szListeningTo);
diff --git a/protocols/MRA/src/MraAdvancedSearch.cpp b/protocols/MRA/src/MraAdvancedSearch.cpp index a8056de463..f793de682b 100644 --- a/protocols/MRA/src/MraAdvancedSearch.cpp +++ b/protocols/MRA/src/MraAdvancedSearch.cpp @@ -77,7 +77,7 @@ void InitComboBoxNumders(HWND hWndCombo, DWORD dwStart, DWORD dwEnd) for (DWORD i = dwStart; i <= dwEnd; i++) {
TCHAR szBuff[MAX_PATH];
- mir_sntprintf(szBuff, _countof(szBuff), _T("%lu"), i);
+ mir_sntprintf(szBuff, _T("%lu"), i);
DWORD dwItem = SendMessage(hWndCombo, CB_ADDSTRING, 0, (LPARAM)szBuff);
SendMessage(hWndCombo, CB_SETITEMDATA, dwItem, i);
}
diff --git a/protocols/MRA/src/MraAvatars.cpp b/protocols/MRA/src/MraAvatars.cpp index 05ccb0ba1e..76339802f0 100644 --- a/protocols/MRA/src/MraAvatars.cpp +++ b/protocols/MRA/src/MraAvatars.cpp @@ -48,7 +48,7 @@ DWORD MraAvatarsHttpTransaction(HANDLE hConnection, DWORD dwRequestType, LPCSTR DWORD CMraProto::MraAvatarsQueueInitialize(HANDLE *phAvatarsQueueHandle)
{
- mir_snprintf(szAvtSectName, _countof(szAvtSectName), "%s Avatars", m_szModuleName);
+ mir_snprintf(szAvtSectName, "%s Avatars", m_szModuleName);
if (phAvatarsQueueHandle == NULL)
return ERROR_INVALID_HANDLE;
@@ -230,7 +230,7 @@ void CMraProto::MraAvatarsThreadProc(LPVOID lpParameter) break;
default:
- mir_sntprintf(szErrorText, _countof(szErrorText), TranslateT("Avatars: server return HTTP code: %lu"), dwResultCode);
+ mir_sntprintf(szErrorText, TranslateT("Avatars: server return HTTP code: %lu"), dwResultCode);
ShowFormattedErrorMessage(szErrorText, NO_ERROR);
break;
}
@@ -288,7 +288,7 @@ void CMraProto::MraAvatarsThreadProc(LPVOID lpParameter) }
else {
dwErrorCode = GetLastError();
- mir_sntprintf(szErrorText, _countof(szErrorText), TranslateT("Avatars: can't open file %s, error"), wszFileName);
+ mir_sntprintf(szErrorText, TranslateT("Avatars: can't open file %s, error"), wszFileName);
ShowFormattedErrorMessage(szErrorText, dwErrorCode);
}
}
@@ -375,7 +375,7 @@ DWORD MraAvatarsHttpTransaction(HANDLE hConnection, DWORD dwRequestType, LPCSTR }
char szBuff[4096];
- mir_snprintf(szBuff, _countof(szBuff), "http://%s/%s/%s/%s", lpszHost, lpszDomain, lpszUser, lpszReqObj);
+ mir_snprintf(szBuff, "http://%s/%s/%s/%s", lpszHost, lpszDomain, lpszUser, lpszReqObj);
CMStringA szSelfVersionString = MraGetSelfVersionString();
NETLIBHTTPHEADER nlbhHeaders[8] = { 0 };
@@ -473,7 +473,7 @@ DWORD CMraProto::MraAvatarsGetFileName(HANDLE hQueue, MCONTACT hContact, DWORD d return ERROR_NOT_SUPPORTED;
TCHAR tszBase[MAX_PATH];
- mir_sntprintf(tszBase, _countof(tszBase), _T("%s\\%s\\"), VARST(_T("%miranda_avatarcache%")), m_tszUserName);
+ mir_sntprintf(tszBase, _T("%s\\%s\\"), VARST(_T("%miranda_avatarcache%")), m_tszUserName);
res = tszBase;
// some path in buff and free space for file name is avaible
diff --git a/protocols/MRA/src/MraFilesQueue.cpp b/protocols/MRA/src/MraFilesQueue.cpp index cc7c1621cc..9ddef0f711 100644 --- a/protocols/MRA/src/MraFilesQueue.cpp +++ b/protocols/MRA/src/MraFilesQueue.cpp @@ -857,7 +857,7 @@ void CMraProto::MraFilesQueueRecvThreadProc(LPVOID lpParameter) }
else {// err allocating file disk space
dwRetErrorCode = GetLastError();
- mir_sntprintf(szErrorText, _countof(szErrorText), TranslateT("Receive files: can't allocate disk space for file, size %lu bytes, error"), dat->pmfqfFiles[i].dwSize);
+ mir_sntprintf(szErrorText, TranslateT("Receive files: can't allocate disk space for file, size %lu bytes, error"), dat->pmfqfFiles[i].dwSize);
ShowFormattedErrorMessage(szErrorText, dwRetErrorCode);
}
CloseHandle(hFile);
@@ -870,7 +870,7 @@ void CMraProto::MraFilesQueueRecvThreadProc(LPVOID lpParameter) }
else {// err on open file
dwRetErrorCode = GetLastError();
- mir_sntprintf(szErrorText, _countof(szErrorText), TranslateT("Receive files: can't open file %s, error"), wszFileName);
+ mir_sntprintf(szErrorText, TranslateT("Receive files: can't open file %s, error"), wszFileName);
ShowFormattedErrorMessage(szErrorText, dwRetErrorCode);
bFailed = TRUE;
break;
@@ -878,7 +878,7 @@ void CMraProto::MraFilesQueueRecvThreadProc(LPVOID lpParameter) }
else {// err on send request for file
dwRetErrorCode = GetLastError();
- mir_sntprintf(szErrorText, _countof(szErrorText), TranslateT("Receive files: request for file %s not sent, error"), dat->pmfqfFiles[i].lpwszName);
+ mir_sntprintf(szErrorText, TranslateT("Receive files: request for file %s not sent, error"), dat->pmfqfFiles[i].lpwszName);
ShowFormattedErrorMessage(szErrorText, NO_ERROR);
bFailed = TRUE;
break;
@@ -1101,14 +1101,14 @@ void CMraProto::MraFilesQueueSendThreadProc(LPVOID lpParameter) }
else { // err on open file
dwRetErrorCode = GetLastError();
- mir_sntprintf(szErrorText, _countof(szErrorText), TranslateT("Send files: can't open file %s, error"), dat->pmfqfFiles[j].lpwszName);
+ mir_sntprintf(szErrorText, TranslateT("Send files: can't open file %s, error"), dat->pmfqfFiles[j].lpwszName);
ShowFormattedErrorMessage(szErrorText, dwRetErrorCode);
bFailed = TRUE;
break;
}
}
else {
- mir_sntprintf(szErrorText, _countof(szErrorText), TranslateT("Send files: requested file: %S - not found in send files list."), (((LPSTR)btBuff) + sizeof(MRA_FT_GET_FILE)));
+ mir_sntprintf(szErrorText, TranslateT("Send files: requested file: %S - not found in send files list."), (((LPSTR)btBuff) + sizeof(MRA_FT_GET_FILE)));
ShowFormattedErrorMessage(szErrorText, NO_ERROR);
bFailed = TRUE;
break;
diff --git a/protocols/MRA/src/MraIcons.cpp b/protocols/MRA/src/MraIcons.cpp index c92a183c2a..8e71438ceb 100644 --- a/protocols/MRA/src/MraIcons.cpp +++ b/protocols/MRA/src/MraIcons.cpp @@ -108,7 +108,7 @@ void InitXStatusIcons() hXStatusAdvancedStatusIcons[0] = NULL;
for (DWORD i = 1; i < MRA_XSTATUS_COUNT+1; i++) {
char szIconName[MAX_PATH];
- mir_snprintf(szIconName, _countof(szIconName), "mra_xstatus%ld", i);
+ mir_snprintf(szIconName, "mra_xstatus%ld", i);
sid.pszName = szIconName;
int iCurIndex = i+IDI_XSTATUS1-1;
@@ -124,7 +124,7 @@ void DestroyXStatusIcons() char szBuff[MAX_PATH];
for (DWORD i = 1; i < MRA_XSTATUS_COUNT+1; i++) {
- mir_snprintf(szBuff, _countof(szBuff), "mra_xstatus%ld", i);
+ mir_snprintf(szBuff, "mra_xstatus%ld", i);
IcoLib_RemoveIcon(szBuff);
}
diff --git a/protocols/MRA/src/MraPlaces.h b/protocols/MRA/src/MraPlaces.h index 4adccbb8a9..d2b0d4d417 100644 --- a/protocols/MRA/src/MraPlaces.h +++ b/protocols/MRA/src/MraPlaces.h @@ -41,7 +41,7 @@ typedef struct {
if (mrapPlaces[i].dwCityID == 0 && mrapPlaces[i].dwPlaceID == 0)
{
- mir_sntprintf(szBuff, _countof(szBuff), L" {%ld, TEXT(\"%s\")}, ", mrapPlaces[i].dwCountryID, mrapPlaces[i].lpszData);
+ mir_sntprintf(szBuff, L" {%ld, TEXT(\"%s\")}, ", mrapPlaces[i].dwCountryID, mrapPlaces[i].lpszData);
DebugPrintCRLFW(szBuff);
}
}
@@ -53,7 +53,7 @@ typedef struct {
if (mrapPlaces[i].dwCityID && mrapPlaces[i].dwPlaceID == 0)
{
- mir_sntprintf(szBuff, _countof(szBuff), L" {%ld, %ld, TEXT(\"%s\")}, ", mrapPlaces[i].dwCountryID, mrapPlaces[i].dwCityID, mrapPlaces[i].lpszData);
+ mir_sntprintf(szBuff, L" {%ld, %ld, TEXT(\"%s\")}, ", mrapPlaces[i].dwCountryID, mrapPlaces[i].dwCityID, mrapPlaces[i].lpszData);
DebugPrintCRLFW(szBuff);
}
}
diff --git a/protocols/MRA/src/MraPopUp.cpp b/protocols/MRA/src/MraPopUp.cpp index 3fb69e53aa..1665a6543c 100644 --- a/protocols/MRA/src/MraPopUp.cpp +++ b/protocols/MRA/src/MraPopUp.cpp @@ -47,20 +47,20 @@ INT_PTR CALLBACK MraPopupDlgProcOpts(HWND hWndDlg, UINT msg, WPARAM wParam, LPAR bEnabled = GetBit(ppro->getDword("PopupsEventFilter", MRA_DEFAULT_POPUPS_EVENT_FILTER), dwType);
CheckDlgButton(hWndDlg, IDC_CHK_ENABLE, bEnabled ? BST_CHECKED : BST_UNCHECKED);
- mir_snprintf(szBuff, _countof(szBuff), "PopupType%SUseWinColors", lpcwszPopupsTypes[dwType]);
+ mir_snprintf(szBuff, "PopupType%SUseWinColors", lpcwszPopupsTypes[dwType]);
bUseWinColors = ppro->getByte(szBuff, MRA_DEFAULT_POPUP_USE_WIN_COLORS);
CheckDlgButton(hWndDlg, IDC_CHK_USE_WIN_COLORS, bUseWinColors ? BST_CHECKED : BST_UNCHECKED);
EnableWindow(GetDlgItem(hWndDlg, IDC_CHK_USE_WIN_COLORS), bEnabled);
- mir_snprintf(szBuff, _countof(szBuff), "PopupType%SColorBack", lpcwszPopupsTypes[dwType]);
+ mir_snprintf(szBuff, "PopupType%SColorBack", lpcwszPopupsTypes[dwType]);
SendDlgItemMessage(hWndDlg, IDC_POPUP_BACKCOLOR, CPM_SETCOLOUR, 0, ppro->getDword(szBuff, MRA_DEFAULT_POPUP_COLOR_BACK));
EnableWindow(GetDlgItem(hWndDlg, IDC_POPUP_BACKCOLOR), (bEnabled && bUseWinColors == FALSE));
- mir_snprintf(szBuff, _countof(szBuff), "PopupType%SColorText", lpcwszPopupsTypes[dwType]);
+ mir_snprintf(szBuff, "PopupType%SColorText", lpcwszPopupsTypes[dwType]);
SendDlgItemMessage(hWndDlg, IDC_POPUP_TEXTCOLOR, CPM_SETCOLOUR, 0, ppro->getDword(szBuff, MRA_DEFAULT_POPUP_COLOR_TEXT));
EnableWindow(GetDlgItem(hWndDlg, IDC_POPUP_TEXTCOLOR), (bEnabled && bUseWinColors == FALSE));
- mir_snprintf(szBuff, _countof(szBuff), "PopupType%STimeout", lpcwszPopupsTypes[dwType]);
+ mir_snprintf(szBuff, "PopupType%STimeout", lpcwszPopupsTypes[dwType]);
SetDlgItemInt(hWndDlg, IDC_POPUP_TIMEOUT, ppro->getDword(szBuff, MRA_DEFAULT_POPUP_TIMEOUT), FALSE);
EnableWindow(GetDlgItem(hWndDlg, IDC_POPUP_TIMEOUT), bEnabled);
}
@@ -105,16 +105,16 @@ INT_PTR CALLBACK MraPopupDlgProcOpts(HWND hWndDlg, UINT msg, WPARAM wParam, LPAR ppro->setDword("PopupsEventFilter", dwPopupsEventFilter);
- mir_snprintf(szBuff, _countof(szBuff), "PopupType%SUseWinColors", lpcwszPopupsTypes[dwType]);
+ mir_snprintf(szBuff, "PopupType%SUseWinColors", lpcwszPopupsTypes[dwType]);
ppro->setByte(szBuff, IsDlgButtonChecked(hWndDlg, IDC_CHK_USE_WIN_COLORS));
- mir_snprintf(szBuff, _countof(szBuff), "PopupType%SColorBack", lpcwszPopupsTypes[dwType]);
+ mir_snprintf(szBuff, "PopupType%SColorBack", lpcwszPopupsTypes[dwType]);
ppro->setDword(szBuff, SendDlgItemMessage(hWndDlg, IDC_POPUP_BACKCOLOR, CPM_GETCOLOUR, 0, 0));
- mir_snprintf(szBuff, _countof(szBuff), "PopupType%SColorText", lpcwszPopupsTypes[dwType]);
+ mir_snprintf(szBuff, "PopupType%SColorText", lpcwszPopupsTypes[dwType]);
ppro->setDword(szBuff, SendDlgItemMessage(hWndDlg, IDC_POPUP_TEXTCOLOR, CPM_GETCOLOUR, 0, 0));
- mir_snprintf(szBuff, _countof(szBuff), "PopupType%STimeout", lpcwszPopupsTypes[dwType]);
+ mir_snprintf(szBuff, "PopupType%STimeout", lpcwszPopupsTypes[dwType]);
ppro->setDword(szBuff, GetDlgItemInt(hWndDlg, IDC_POPUP_TIMEOUT, NULL, FALSE));
}
return TRUE;
@@ -262,21 +262,21 @@ void CMraProto::MraPopupShowW(MCONTACT hContact, DWORD dwType, DWORD dwFlags, LP ppd.PluginData = dat;
char szBuff[MAX_PATH];
- mir_snprintf(szBuff, _countof(szBuff), "PopupType%SUseWinColors", lpcwszPopupsTypes[dwType]);
+ mir_snprintf(szBuff, "PopupType%SUseWinColors", lpcwszPopupsTypes[dwType]);
BOOL bUseWinColors = getByte(szBuff, MRA_DEFAULT_POPUP_USE_WIN_COLORS);
if (bUseWinColors) {
ppd.colorBack = GetSysColor(COLOR_BTNFACE);
ppd.colorText = GetSysColor(COLOR_WINDOWTEXT);
}
else {
- mir_snprintf(szBuff, _countof(szBuff), "PopupType%SColorBack", lpcwszPopupsTypes[dwType]);
+ mir_snprintf(szBuff, "PopupType%SColorBack", lpcwszPopupsTypes[dwType]);
ppd.colorBack = getDword(szBuff, MRA_DEFAULT_POPUP_COLOR_BACK);
- mir_snprintf(szBuff, _countof(szBuff), "PopupType%SColorText", lpcwszPopupsTypes[dwType]);
+ mir_snprintf(szBuff, "PopupType%SColorText", lpcwszPopupsTypes[dwType]);
ppd.colorText = getDword(szBuff, MRA_DEFAULT_POPUP_COLOR_TEXT);
}
- mir_snprintf(szBuff, _countof(szBuff), "PopupType%STimeout", lpcwszPopupsTypes[dwType]);
+ mir_snprintf(szBuff, "PopupType%STimeout", lpcwszPopupsTypes[dwType]);
ppd.iSeconds = getDword(szBuff, MRA_DEFAULT_POPUP_TIMEOUT);
if (dat->iPopupType == MRA_POPUP_TYPE_EMAIL_STATUS && dat->ppro->hWndEMailPopupStatus)
diff --git a/protocols/MRA/src/MraProto.cpp b/protocols/MRA/src/MraProto.cpp index 012b3d0247..2ac6cdec77 100644 --- a/protocols/MRA/src/MraProto.cpp +++ b/protocols/MRA/src/MraProto.cpp @@ -36,7 +36,7 @@ CMraProto::CMraProto(const char* _module, const TCHAR* _displayName) : m_heNudgeReceived = CreateProtoEvent(PE_NUDGE);
TCHAR name[MAX_PATH];
- mir_sntprintf(name, _countof(name), TranslateT("%s connection"), m_tszUserName);
+ mir_sntprintf(name, TranslateT("%s connection"), m_tszUserName);
NETLIBUSER nlu = { sizeof(nlu) };
nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR;
@@ -46,7 +46,7 @@ CMraProto::CMraProto(const char* _module, const TCHAR* _displayName) : InitMenus();
- mir_snprintf(szNewMailSound, _countof(szNewMailSound), "%s_new_email", m_szModuleName);
+ mir_snprintf(szNewMailSound, "%s_new_email", m_szModuleName);
SkinAddNewSoundEx(szNewMailSound, m_szModuleName, MRA_SOUND_NEW_EMAIL);
HookProtoEvent(ME_CLIST_PREBUILDSTATUSMENU, &CMraProto::MraRebuildStatusMenu);
@@ -525,11 +525,11 @@ HANDLE CMraProto::GetAwayMsg(MCONTACT hContact) SYSTEMTIME tt = { 0 };
dwTime = getDword(hContact, DBSETTING_BLOGSTATUSTIME, 0);
if (dwTime && MakeLocalSystemTimeFromTime32(dwTime, &tt))
- mir_sntprintf(szTime, _countof(szTime), _T("%04ld.%02ld.%02ld %02ld:%02ld: "), tt.wYear, tt.wMonth, tt.wDay, tt.wHour, tt.wMinute);
+ mir_sntprintf(szTime, _T("%04ld.%02ld.%02ld %02ld:%02ld: "), tt.wYear, tt.wMonth, tt.wDay, tt.wHour, tt.wMinute);
else
szTime[0] = 0;
- mir_sntprintf(szStatusDesc, _countof(szStatusDesc), _T("%s%s"), szTime, szBlogStatus.c_str());
+ mir_sntprintf(szStatusDesc, _T("%s%s"), szTime, szBlogStatus.c_str());
iRet = GetTickCount();
ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)iRet, (LPARAM)szStatusDesc);
}
diff --git a/protocols/MRA/src/MraSelectEMail.cpp b/protocols/MRA/src/MraSelectEMail.cpp index f43beb4a9d..8925910c2a 100644 --- a/protocols/MRA/src/MraSelectEMail.cpp +++ b/protocols/MRA/src/MraSelectEMail.cpp @@ -22,7 +22,7 @@ void AddContactEMailToListParam(MCONTACT hContact, BOOL bMRAOnly, LPSTR lpszModu for (int i = 0; true; i++) {
char szBuff[MAX_PATH];
- mir_snprintf(szBuff, _countof(szBuff), "%s%lu", lpszValueName, i);
+ mir_snprintf(szBuff, "%s%lu", lpszValueName, i);
if (DB_GetStringA(hContact, lpszModule, szBuff, szEmail)) {
if (bMRAOnly == FALSE || IsEMailMR(szEmail)) {
WCHAR wszBuff[MAX_EMAIL_LEN];
diff --git a/protocols/MRA/src/Mra_functions.cpp b/protocols/MRA/src/Mra_functions.cpp index ef7ded50ad..2031f3ad84 100644 --- a/protocols/MRA/src/Mra_functions.cpp +++ b/protocols/MRA/src/Mra_functions.cpp @@ -423,7 +423,7 @@ DWORD CMraProto::GetContactBasicInfoW(MCONTACT hContact, DWORD *pdwID, DWORD *pd for (int i = 0; i < 3; i++) {
char szValue[50];
- mir_snprintf(szValue, _countof(szValue), "MyPhone%d", i);
+ mir_snprintf(szValue, "MyPhone%d", i);
if (DB_GetStringA(hContact, "UserInfo", szValue, szPhone)) {
if (szPhones->GetLength())
szPhones->AppendChar(',');
@@ -474,7 +474,7 @@ DWORD CMraProto::SetContactBasicInfoW(MCONTACT hContact, DWORD dwSetInfoFlags, D break;
char szValue[MAX_PATH];
- mir_snprintf(szValue, _countof(szValue), "MyPhone%d", i++);
+ mir_snprintf(szValue, "MyPhone%d", i++);
DB_SetStringExA(hContact, "UserInfo", szValue, "+" + szPhone);
}
}
@@ -644,14 +644,14 @@ void CMraProto::MraUpdateEmailStatus(const CMStringA &pszFrom, const CMStringA & MCONTACT hContact = NULL;
TCHAR szMailBoxStatus[MAX_SECONDLINE];
- mir_sntprintf(szMailBoxStatus, _countof(szMailBoxStatus), TranslateT("Unread mail is available: %lu/%lu messages"), m_dwEmailMessagesUnread, dwEmailMessagesTotal);
+ mir_sntprintf(szMailBoxStatus, TranslateT("Unread mail is available: %lu/%lu messages"), m_dwEmailMessagesUnread, dwEmailMessagesTotal);
if (!pszFrom.IsEmpty() || !pszSubject.IsEmpty()) {
CMStringA szFrom, szSubject;
if (GetEMailFromString(szFrom, szEmail))
hContact = MraHContactFromEmail(szEmail, FALSE, TRUE, NULL);
- mir_sntprintf(szStatusText, _countof(szStatusText), TranslateT("From: %S\r\nSubject: %S\r\n%s"), pszFrom.c_str(), szSubject.c_str(), szMailBoxStatus);
+ mir_sntprintf(szStatusText, TranslateT("From: %S\r\nSubject: %S\r\n%s"), pszFrom.c_str(), szSubject.c_str(), szMailBoxStatus);
}
else _tcsncpy_s(szStatusText, szMailBoxStatus, _TRUNCATE);
@@ -692,7 +692,7 @@ void CMraProto::MraUpdateEmailStatus(const CMStringA &pszFrom, const CMStringA & hWndEMailPopupStatus = NULL;
}
else {
- mir_sntprintf(szStatusText, _countof(szStatusText), TranslateT("No unread mail is available\r\nTotal messages: %lu"), dwEmailMessagesTotal);
+ mir_sntprintf(szStatusText, TranslateT("No unread mail is available\r\nTotal messages: %lu"), dwEmailMessagesTotal);
MraPopupShowFromAgentW(MRA_POPUP_TYPE_EMAIL_STATUS, (MRA_POPUP_ALLOW_ENTER), szStatusText);
}
}
@@ -802,7 +802,7 @@ DWORD GetContactEMailCountParam(MCONTACT hContact, BOOL bMRAOnly, LPSTR lpszModu for (int i = 0; TRUE; i++) {
char szBuff[100];
- mir_snprintf(szBuff, _countof(szBuff), "%s%lu", lpszValueName, i);
+ mir_snprintf(szBuff, "%s%lu", lpszValueName, i);
if (DB_GetStringA(hContact, lpszModule, szBuff, szEmail)) {
if (bMRAOnly == FALSE || IsEMailMR(szEmail))
dwRet++;
@@ -840,7 +840,7 @@ bool GetContactFirstEMailParam(MCONTACT hContact, BOOL bMRAOnly, LPSTR lpszModul for (int i = 0; true; i++) {
char szBuff[100];
- mir_snprintf(szBuff, _countof(szBuff), "%s%lu", lpszValueName, i);
+ mir_snprintf(szBuff, "%s%lu", lpszValueName, i);
if (DB_GetStringA(hContact, lpszModule, szBuff, szEmail)) {
if (bMRAOnly == FALSE || IsEMailMR(szEmail)) {
res = szEmail;
@@ -877,7 +877,7 @@ void CMraProto::ShowFormattedErrorMessage(LPWSTR lpwszErrText, DWORD dwErrorCode else {
dwErrDescriptionSize = (FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwErrorCode, 0, szErrDescription, (_countof(szErrDescription) - sizeof(WCHAR)), NULL) - 2);
szErrDescription[dwErrDescriptionSize] = 0;
- mir_sntprintf(szErrorText, _countof(szErrorText), _T("%s %lu: %s"), TranslateTS(lpwszErrText), dwErrorCode, szErrDescription);
+ mir_sntprintf(szErrorText, _T("%s %lu: %s"), TranslateTS(lpwszErrText), dwErrorCode, szErrDescription);
}
MraPopupShowFromAgentW(MRA_POPUP_TYPE_ERROR, 0, szErrorText);
}
@@ -996,13 +996,13 @@ INT_PTR CALLBACK SetXStatusDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LP SendMessage(hWndDlg, WM_SETICON, ICON_BIG, (LPARAM)dat->hDlgIcon);
SetWindowText(hWndDlg, TranslateTS(lpcszXStatusNameDef[dat->dwXStatus]));
- mir_snprintf(szValueName, _countof(szValueName), "XStatus%ldName", dat->dwXStatus);
+ mir_snprintf(szValueName, "XStatus%ldName", dat->dwXStatus);
if (dat->ppro->mraGetStringW(NULL, szValueName, szBuff))
SetDlgItemText(hWndDlg, IDC_XTITLE, szBuff.c_str()); // custom xstatus name
else // default xstatus name
SetDlgItemText(hWndDlg, IDC_XTITLE, TranslateTS(lpcszXStatusNameDef[dat->dwXStatus]));
- mir_snprintf(szValueName, _countof(szValueName), "XStatus%ldMsg", dat->dwXStatus);
+ mir_snprintf(szValueName, "XStatus%ldMsg", dat->dwXStatus);
if (dat->ppro->mraGetStringW(NULL, szValueName, szBuff))
SetDlgItemText(hWndDlg, IDC_XMSG, szBuff.c_str()); // custom xstatus description
else // default xstatus description
@@ -1017,7 +1017,7 @@ INT_PTR CALLBACK SetXStatusDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LP case WM_TIMER:
if (dat->dwCountdown != -1) {
TCHAR szBuff[MAX_PATH];
- mir_sntprintf(szBuff, _countof(szBuff), TranslateT("Closing in %ld"), dat->dwCountdown--);
+ mir_sntprintf(szBuff, TranslateT("Closing in %ld"), dat->dwCountdown--);
SetDlgItemText(hWndDlg, IDOK, szBuff);
break;
}
@@ -1047,7 +1047,7 @@ INT_PTR CALLBACK SetXStatusDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LP DWORD dwBuffSize = GetDlgItemText(hWndDlg, IDC_XMSG, szBuff, (STATUS_DESC_MAX + 1));
char szValueName[MAX_PATH];
- mir_snprintf(szValueName, _countof(szValueName), "XStatus%ldMsg", dat->dwXStatus);
+ mir_snprintf(szValueName, "XStatus%ldMsg", dat->dwXStatus);
dat->ppro->mraSetStringExW(NULL, szValueName, szBuff);
dat->ppro->mraSetStringExW(NULL, DBSETTING_XSTATUSMSG, szBuff);
@@ -1056,7 +1056,7 @@ INT_PTR CALLBACK SetXStatusDlgProc(HWND hWndDlg, UINT message, WPARAM wParam, LP mir_tstrncpy(szBuff, TranslateTS(lpcszXStatusNameDef[dat->dwXStatus]), STATUS_TITLE_MAX + 1);
dwBuffSize = (DWORD)mir_wstrlen(szBuff);
}
- mir_snprintf(szValueName, _countof(szValueName), "XStatus%dName", dat->dwXStatus);
+ mir_snprintf(szValueName, "XStatus%dName", dat->dwXStatus);
dat->ppro->mraSetStringExW(NULL, szValueName, szBuff);
dat->ppro->mraSetStringExW(NULL, DBSETTING_XSTATUSNAME, szBuff);
@@ -1173,7 +1173,7 @@ INT_PTR CALLBACK SendReplyBlogStatusDlgProc(HWND hWndDlg, UINT message, WPARAM w size_t dwMessageSize = GetWindowTextLength(GetDlgItem(hWndDlg, IDC_MSG_TO_SEND));
EnableWindow(GetDlgItem(hWndDlg, IDOK), (int)dwMessageSize);
- mir_sntprintf(tszBuff, _countof(tszBuff), _T("%d/%d"), dwMessageSize, MICBLOG_STATUS_MAX);
+ mir_sntprintf(tszBuff, _T("%d/%d"), dwMessageSize, MICBLOG_STATUS_MAX);
SetDlgItemText(hWndDlg, IDC_STATIC_CHARS_COUNTER, tszBuff);
}
break;
diff --git a/protocols/MRA/src/Mra_menus.cpp b/protocols/MRA/src/Mra_menus.cpp index b251560c18..59d26b620e 100644 --- a/protocols/MRA/src/Mra_menus.cpp +++ b/protocols/MRA/src/Mra_menus.cpp @@ -282,7 +282,7 @@ int CMraProto::MraRebuildStatusMenu(WPARAM, LPARAM) HGENMENU hRoot;
{
TCHAR szItem[MAX_PATH + 64];
- mir_sntprintf(szItem, _countof(szItem), _T("%s Custom Status"), m_tszUserName);
+ mir_sntprintf(szItem, _T("%s Custom Status"), m_tszUserName);
CMenuItem mi;
mi.root = pcli->pfnGetProtocolMenu(m_szModuleName);
@@ -303,10 +303,10 @@ int CMraProto::MraRebuildStatusMenu(WPARAM, LPARAM) if (getByte(NULL, "xStatusShowAll", MRA_DEFAULT_SHOW_ALL_XSTATUSES))
dwCount = MRA_XSTATUS_COUNT;
for (DWORD i = 0; i < dwCount; i ++) {
- mir_snprintf(szServiceFunction, _countof(szServiceFunction), "/menuXStatus%ld", i);
+ mir_snprintf(szServiceFunction, "/menuXStatus%ld", i);
mi.position ++;
if (i) {
- mir_snprintf(szValueName, _countof(szValueName), "XStatus%ldName", i);
+ mir_snprintf(szValueName, "XStatus%ldName", i);
if (mraGetStringW(NULL, szValueName, szStatusTitle))
mi.name.t = (TCHAR*)szStatusTitle.c_str();
else
@@ -400,7 +400,7 @@ void CMraProto::InitMenus() // xstatus menu
for (DWORD i = 0; i < MRA_XSTATUS_COUNT; i++) {
char szServiceName[100];
- mir_snprintf(szServiceName, _countof(szServiceName), "/menuXStatus%d", i);
+ mir_snprintf(szServiceName, "/menuXStatus%d", i);
CreateProtoServiceParam(szServiceName, &CMraProto::MraXStatusMenu, i);
}
}
diff --git a/protocols/MRA/src/Mra_proto.cpp b/protocols/MRA/src/Mra_proto.cpp index 0975551c5e..23f02d6ed6 100644 --- a/protocols/MRA/src/Mra_proto.cpp +++ b/protocols/MRA/src/Mra_proto.cpp @@ -349,11 +349,11 @@ bool CMraProto::CmdHelloAck(BinBuffer &buf) DWORD dwXStatusMir = m_iXStatus, dwXStatus;
DWORD dwStatus = GetMraStatusFromMiradaStatus(m_iDesiredStatus, dwXStatusMir, &dwXStatus);
if (IsXStatusValid(dwXStatusMir)) {// xstatuses
- mir_snprintf(szValueName, _countof(szValueName), "XStatus%ldName", dwXStatusMir);
+ mir_snprintf(szValueName, "XStatus%ldName", dwXStatusMir);
if (!mraGetStringW(NULL, szValueName, wszStatusTitle))
wszStatusTitle = TranslateTS(lpcszXStatusNameDef[dwXStatusMir]);
- mir_snprintf(szValueName, _countof(szValueName), "XStatus%ldMsg", dwXStatusMir);
+ mir_snprintf(szValueName, "XStatus%ldMsg", dwXStatusMir);
mraGetStringW(NULL, szValueName, wszStatusDesc);
}
else wszStatusTitle = pcli->pfnGetStatusModeDescription(m_iDesiredStatus, 0);
@@ -646,7 +646,7 @@ bool CMraProto::CmdFileTransferAck(BinBuffer &buf) break;
default:// ## unknown error
TCHAR szBuff[1024];
- mir_sntprintf(szBuff, _countof(szBuff), TranslateT("MRIM_CS_FILE_TRANSFER_ACK: unknown error, code: %lu"), dwAckType);
+ mir_sntprintf(szBuff, TranslateT("MRIM_CS_FILE_TRANSFER_ACK: unknown error, code: %lu"), dwAckType);
ShowFormattedErrorMessage(szBuff, NO_ERROR);
break;
}
@@ -743,7 +743,7 @@ bool CMraProto::CmdContactAck(int cmd, int seq, BinBuffer &buf) break;
default:// ## unknown error
TCHAR szBuff[1024];
- mir_sntprintf(szBuff, _countof(szBuff), TranslateT("MRIM_CS_*_CONTACT_ACK: unknown server error, code: %lu"), dwTemp);
+ mir_sntprintf(szBuff, TranslateT("MRIM_CS_*_CONTACT_ACK: unknown server error, code: %lu"), dwTemp);
MraPopupShowFromAgentW(MRA_POPUP_TYPE_DEBUG, 0, szBuff);
break;
}
@@ -1037,7 +1037,7 @@ bool CMraProto::CmdGame(BinBuffer &buf) break;
default:
TCHAR szBuff[1024];
- mir_sntprintf(szBuff, _countof(szBuff), TranslateT("MRIM_CS_GAME: unknown internal game message code: %lu"), dwGameMsg);
+ mir_sntprintf(szBuff, TranslateT("MRIM_CS_GAME: unknown internal game message code: %lu"), dwGameMsg);
MraPopupShowFromAgentW(MRA_POPUP_TYPE_DEBUG, 0, szBuff);
break;
}
@@ -1205,7 +1205,7 @@ bool CMraProto::CmdClist2(BinBuffer &buf) }
else if (fieldType == 'u') {
char szBuff[50];
- mir_snprintf(szBuff, _countof(szBuff), "%lu, ", dwTemp);//;
+ mir_snprintf(szBuff, "%lu, ", dwTemp);//;
debugLogA("%s ", szBuff);
}
else _CrtDbgBreak();
@@ -1345,7 +1345,7 @@ bool CMraProto::CmdClist2(BinBuffer &buf) ShowFormattedErrorMessage(L"MRIM_CS_CONTACT_LIST2: internal server error", NO_ERROR);
else {
TCHAR szBuff[1024];
- mir_sntprintf(szBuff, _countof(szBuff), TranslateT("MRIM_CS_CONTACT_LIST2: unknown server error, code: %lu"), dwTemp);
+ mir_sntprintf(szBuff, TranslateT("MRIM_CS_CONTACT_LIST2: unknown server error, code: %lu"), dwTemp);
MraPopupShowFromAgentW(MRA_POPUP_TYPE_DEBUG, 0, szBuff);
}
}
diff --git a/protocols/MRA/src/Mra_svcs.cpp b/protocols/MRA/src/Mra_svcs.cpp index 0440cfa9eb..4b74f823a0 100644 --- a/protocols/MRA/src/Mra_svcs.cpp +++ b/protocols/MRA/src/Mra_svcs.cpp @@ -353,13 +353,13 @@ DWORD CMraProto::MraSetXStatusInternal(DWORD dwXStatus) // obsolete (TODO: remove in next version)
char szValueName[MAX_PATH];
- mir_snprintf(szValueName, _countof(szValueName), "XStatus%ldName", dwXStatus);
+ mir_snprintf(szValueName, "XStatus%ldName", dwXStatus);
if (!mraGetStringW(NULL, szValueName, szBuff))
szBuff = lpcszXStatusNameDef[dwXStatus];
mraSetStringExW(NULL, DBSETTING_XSTATUSNAME, szBuff);
// obsolete (TODO: remove in next version)
- mir_snprintf(szValueName, _countof(szValueName), "XStatus%ldMsg", dwXStatus);
+ mir_snprintf(szValueName, "XStatus%ldMsg", dwXStatus);
if (mraGetStringW(NULL, szValueName, szBuff))
mraSetStringExW(NULL, DBSETTING_XSTATUSMSG, szBuff);
else
@@ -401,7 +401,7 @@ INT_PTR CMraProto::MraSetXStatusEx(WPARAM, LPARAM lParam) // set custom status name
if (pData->flags & CSSF_MASK_NAME) {
- mir_snprintf(szValueName, _countof(szValueName), "XStatus%ldName", dwXStatus);
+ mir_snprintf(szValueName, "XStatus%ldName", dwXStatus);
if (pData->flags & CSSF_UNICODE) {
mraSetStringExW(NULL, szValueName, pData->pwszName);
mraSetStringExW(NULL, DBSETTING_XSTATUSNAME, pData->pwszName);
@@ -414,7 +414,7 @@ INT_PTR CMraProto::MraSetXStatusEx(WPARAM, LPARAM lParam) // set custom status message
if (pData->flags & CSSF_MASK_MESSAGE) {
- mir_snprintf(szValueName, _countof(szValueName), "XStatus%ldMsg", dwXStatus);
+ mir_snprintf(szValueName, "XStatus%ldMsg", dwXStatus);
if (pData->flags & CSSF_UNICODE) {
mraSetStringExW(NULL, szValueName, pData->pwszMessage);
mraSetStringExW(NULL, DBSETTING_XSTATUSMSG, pData->pwszMessage);
@@ -528,7 +528,7 @@ DWORD CMraProto::MraSendNewStatus(DWORD dwStatusMir, DWORD dwXStatusMir, const C if (IsXStatusValid(dwXStatusMir)) {
char szValueName[MAX_PATH];
if (pwszStatusTitle.IsEmpty()) {
- mir_snprintf(szValueName, _countof(szValueName), "XStatus%ldName", dwXStatusMir);
+ mir_snprintf(szValueName, "XStatus%ldName", dwXStatusMir);
// custom xstatus name
if (!mraGetStringW(NULL, szValueName, wszStatusTitle))
wszStatusTitle = TranslateTS(lpcszXStatusNameDef[dwXStatusMir]);
@@ -536,7 +536,7 @@ DWORD CMraProto::MraSendNewStatus(DWORD dwStatusMir, DWORD dwXStatusMir, const C else wszStatusTitle = pwszStatusTitle;
if (pwszStatusDesc.IsEmpty()) {
- mir_snprintf(szValueName, _countof(szValueName), "XStatus%ldMsg", dwXStatusMir);
+ mir_snprintf(szValueName, "XStatus%ldMsg", dwXStatusMir);
// custom xstatus description
mraGetStringW(NULL, szValueName, wszStatusDesc);
}
diff --git a/protocols/MSN/src/msn_auth.cpp b/protocols/MSN/src/msn_auth.cpp index b8f403a100..aead5f7480 100644 --- a/protocols/MSN/src/msn_auth.cpp +++ b/protocols/MSN/src/msn_auth.cpp @@ -278,7 +278,7 @@ int CMsnProto::MSN_GetPassportAuth(void) }
else if (retVal != 3 && retVal != 7) {
char err[512];
- mir_snprintf(err, _countof(err), "Unknown Authentication error: %s", szFault);
+ mir_snprintf(err, "Unknown Authentication error: %s", szFault);
MSN_ShowError(err);
}
}
diff --git a/protocols/MSN/src/msn_commands.cpp b/protocols/MSN/src/msn_commands.cpp index 6bb8167167..fbecb676ac 100644 --- a/protocols/MSN/src/msn_commands.cpp +++ b/protocols/MSN/src/msn_commands.cpp @@ -480,7 +480,7 @@ void CMsnProto::MSN_ProcessURIObject(MCONTACT hContact, ezxml_t xmli) sprintf(ft->szInvcookie, "%s/content/imgpsh", uri);
TCHAR tComment[40];
- mir_sntprintf(tComment, _countof(tComment), TranslateT("%I64u bytes"), ft->std.currentFileSize);
+ mir_sntprintf(tComment, TranslateT("%I64u bytes"), ft->std.currentFileSize);
PROTORECVFILET pre = { 0 };
pre.dwFlags = PRFF_TCHAR;
@@ -521,7 +521,7 @@ void CMsnProto::MSN_ProcessYFind(char* buf, size_t len) const char* szCont = ezxml_attr(cont, "n");
char szEmail[128];
- mir_snprintf(szEmail, _countof(szEmail), "%s@%s", szCont, szDom);
+ mir_snprintf(szEmail, "%s@%s", szCont, szDom);
const char *szNetId = ezxml_attr(cont, "t");
if (msnSearchId != NULL) {
@@ -761,7 +761,7 @@ void CMsnProto::MSN_ProcessStatusMessage(ezxml_t xmli, const char* wlid) for (unsigned i = 4; i < pCount; i++) {
char part[16];
- size_t lenPart = mir_snprintf(part, _countof(part), "{%d}", i - 4);
+ size_t lenPart = mir_snprintf(part, "{%d}", i - 4);
if (parts[i][0] == '\0' && unknown != NULL)
parts[i] = unknown;
size_t lenPartsI = mir_strlen(parts[i]);
@@ -1431,7 +1431,7 @@ void CMsnProto::MSN_InviteMessage(ThreadData* info, char* msgBody, char* email, ft->p2p_dest = mir_strdup(email);
TCHAR tComment[40];
- mir_sntprintf(tComment, _countof(tComment), TranslateT("%I64u bytes"), ft->std.currentFileSize);
+ mir_sntprintf(tComment, TranslateT("%I64u bytes"), ft->std.currentFileSize);
PROTORECVFILET pre = { 0 };
pre.dwFlags = PRFF_TCHAR;
@@ -1449,9 +1449,9 @@ void CMsnProto::MSN_InviteMessage(ThreadData* info, char* msgBody, char* email, ThreadData* newThread = new ThreadData;
if (inet_addr(IPAddress) != MyConnection.extIP || !IPAddressInt)
- mir_snprintf(newThread->mServer, _countof(newThread->mServer), "%s:%s", IPAddress, Port);
+ mir_snprintf(newThread->mServer, "%s:%s", IPAddress, Port);
else
- mir_snprintf(newThread->mServer, _countof(newThread->mServer), "%s:%u", IPAddressInt, atol(PortXInt) ^ 0x3141);
+ mir_snprintf(newThread->mServer, "%s:%u", IPAddressInt, atol(PortXInt) ^ 0x3141);
newThread->mType = SERVER_FILETRANS;
@@ -1528,7 +1528,7 @@ void CMsnProto::MSN_InviteMessage(ThreadData* info, char* msgBody, char* email, if (IPAddress != NULL && Port == NULL && SessionID != NULL && SessionProtocol == NULL) { // netmeeting receive 2
char ipaddr[256];
- mir_snprintf(ipaddr, _countof(ipaddr), "callto://%s", IPAddress);
+ mir_snprintf(ipaddr, "callto://%s", IPAddress);
ShellExecuteA(NULL, "open", ipaddr, NULL, NULL, SW_SHOW);
}
}
@@ -1545,7 +1545,7 @@ void CMsnProto::MSN_ProcessRemove(char* buf, size_t len) int listId = atol(ezxml_attr(cont, "l"));
char szEmail[128];
- mir_snprintf(szEmail, _countof(szEmail), "%s@%s", szCont, szDom);
+ mir_snprintf(szEmail, "%s@%s", szCont, szDom);
Lists_Remove(listId, szEmail);
MsnContact* msc = Lists_Get(szEmail);
@@ -1641,7 +1641,7 @@ void CMsnProto::MSN_ProcessAdd(char* buf, size_t len) int netId = atol(ezxml_attr(cont, "t"));
char szEmail[128];
- mir_snprintf(szEmail, _countof(szEmail), "%s@%s", szCont, szDom);
+ mir_snprintf(szEmail, "%s@%s", szCont, szDom);
UrlDecode((char*)szNick);
@@ -2203,7 +2203,7 @@ LBL_InvalidCommand: newThread->mType = SERVER_SWITCHBOARD;
newThread->mInitialContactWLID = mir_strdup(data.callerEmail);
MSN_HContactFromEmail(data.callerEmail, data.callerNick, true, true);
- mir_snprintf(newThread->mCookie, _countof(newThread->mCookie), "%s %d", data.authChallengeInfo, trid);
+ mir_snprintf(newThread->mCookie, "%s %d", data.authChallengeInfo, trid);
ReleaseSemaphore(newThread->hWaitEvent, MSN_PACKETS_COMBINE, NULL);
diff --git a/protocols/MSN/src/msn_ftold.cpp b/protocols/MSN/src/msn_ftold.cpp index 94e257fade..bdb3ebd46f 100644 --- a/protocols/MSN/src/msn_ftold.cpp +++ b/protocols/MSN/src/msn_ftold.cpp @@ -64,7 +64,7 @@ void CMsnProto::msnftp_invite(filetransfer *ft) pszFiles = *ft->std.ptszFiles;
char msg[1024];
- mir_snprintf(msg, _countof(msg),
+ mir_snprintf(msg,
"Content-Type: text/x-msmsgsinvite; charset=UTF-8\r\n\r\n"
"Application-Name: File Transfer\r\n"
"Application-GUID: {5D3E02AB-6190-11d3-BBBB-00C04F795683}\r\n"
@@ -152,7 +152,7 @@ int CMsnProto::MSN_HandleMSNFTP(ThreadData *info, char *cmdString) char tCommand[30];
size_t tCommandLen;
- tCommandLen = mir_snprintf(tCommand, _countof(tCommand), "FIL %i\r\n", info->mMsnFtp->std.totalBytes);
+ tCommandLen = mir_snprintf(tCommand, "FIL %i\r\n", info->mMsnFtp->std.totalBytes);
info->send(tCommand, tCommandLen);
break;
@@ -176,7 +176,7 @@ LBL_InvalidCommand: if (info->mCaller == 0) { //receive
char tCommand[MSN_MAX_EMAIL_LEN + 50];
size_t tCommandLen;
- tCommandLen = mir_snprintf(tCommand, _countof(tCommand), "USR %s %s\r\n", MyOptions.szEmail, info->mCookie);
+ tCommandLen = mir_snprintf(tCommand, "USR %s %s\r\n", MyOptions.szEmail, info->mCookie);
info->send(tCommand, tCommandLen);
}
else if (info->mCaller == 2) { //send
diff --git a/protocols/MSN/src/msn_lists.cpp b/protocols/MSN/src/msn_lists.cpp index 2afcc94d86..8e747106ca 100644 --- a/protocols/MSN/src/msn_lists.cpp +++ b/protocols/MSN/src/msn_lists.cpp @@ -243,7 +243,7 @@ void CMsnProto::MSN_CleanupLists(void) mir_free(sze);
TCHAR title[128];
- mir_sntprintf(title, _countof(title), TranslateT("%s protocol"), m_tszUserName);
+ mir_sntprintf(title, TranslateT("%s protocol"), m_tszUserName);
if (MessageBox(NULL, text, title, MB_YESNO | MB_ICONQUESTION | MB_SETFOREGROUND) == IDYES) {
MSN_AddUser(p.hContact, p.email, 0, LIST_LL);
diff --git a/protocols/MSN/src/msn_mail.cpp b/protocols/MSN/src/msn_mail.cpp index 312cc2bfd7..375c28873c 100644 --- a/protocols/MSN/src/msn_mail.cpp +++ b/protocols/MSN/src/msn_mail.cpp @@ -255,14 +255,14 @@ void CMsnProto::sttNotificationMessage(char* msgBody, bool isInitial) wchar_t* mimeSubjectW = tFileInfo.decode(Subject);
- mir_sntprintf(tBuffer2, _countof(tBuffer2), TranslateT("Subject: %s"), mimeSubjectW);
+ mir_sntprintf(tBuffer2, TranslateT("Subject: %s"), mimeSubjectW);
TCHAR* msgtxt = _stricmp(From, Fromaddr) ?
TranslateT("Hotmail from %s (%S)") : TranslateT("Hotmail from %s");
- mir_sntprintf(tBuffer, _countof(tBuffer), msgtxt, mimeFromW, Fromaddr);
+ mir_sntprintf(tBuffer, msgtxt, mimeFromW, Fromaddr);
mir_free(mimeFromW);
mir_free(mimeSubjectW);
ShowPopup = true;
@@ -271,8 +271,8 @@ void CMsnProto::sttNotificationMessage(char* msgBody, bool isInitial) const char* MailData = tFileInfo["Mail-Data"];
if (MailData != NULL) processMailData((char*)MailData);
- mir_sntprintf(tBuffer, _countof(tBuffer), m_tszUserName);
- mir_sntprintf(tBuffer2, _countof(tBuffer2), TranslateT("Unread mail is available: %d in Inbox and %d in other folders."), mUnreadMessages, mUnreadJunkEmails);
+ mir_sntprintf(tBuffer, m_tszUserName);
+ mir_sntprintf(tBuffer2, TranslateT("Unread mail is available: %d in Inbox and %d in other folders."), mUnreadMessages, mUnreadJunkEmails);
}
if (UnreadMessages == mUnreadMessages && UnreadJunkEmails == mUnreadJunkEmails && !isInitial)
@@ -390,8 +390,7 @@ void CMsnProto::displayEmailCount(MCONTACT hContact) rtrimt(name);
TCHAR szNick[128];
- mir_sntprintf(szNick, _countof(szNick),
- getByte("DisableHotmailJunk", 0) ? _T("%s [%d]") : _T("%s [%d][%d]"), name, mUnreadMessages, mUnreadJunkEmails);
+ mir_sntprintf(szNick, getByte("DisableHotmailJunk", 0) ? _T("%s [%d]") : _T("%s [%d][%d]"), name, mUnreadMessages, mUnreadJunkEmails);
nickChg = true;
db_set_ts(hContact, "CList", "MyHandle", szNick);
diff --git a/protocols/MSN/src/msn_menu.cpp b/protocols/MSN/src/msn_menu.cpp index e199fab8da..5d04fa9bc4 100644 --- a/protocols/MSN/src/msn_menu.cpp +++ b/protocols/MSN/src/msn_menu.cpp @@ -93,7 +93,7 @@ INT_PTR CMsnProto::MsnViewProfile(WPARAM hContact, LPARAM) }
char tUrl[256];
- mir_snprintf(tUrl, _countof(tUrl), "http://cid-%I64X.profiles.live.com", _atoi64(cid));
+ mir_snprintf(tUrl, "http://cid-%I64X.profiles.live.com", _atoi64(cid));
MsnInvokeMyURL(false, tUrl);
return 0;
}
@@ -177,7 +177,7 @@ INT_PTR CMsnProto::MsnSendNetMeeting(WPARAM wParam, LPARAM) char msg[1024];
- mir_snprintf(msg, _countof(msg),
+ mir_snprintf(msg,
"Content-Type: text/x-msmsgsinvite; charset=UTF-8\r\n\r\n"
"Application-Name: NetMeeting\r\n"
"Application-GUID: {44BBA842-CC51-11CF-AAFA-00AA00B6015C}\r\n"
diff --git a/protocols/MSN/src/msn_misc.cpp b/protocols/MSN/src/msn_misc.cpp index 9f7f6ab15f..7efabf73f9 100644 --- a/protocols/MSN/src/msn_misc.cpp +++ b/protocols/MSN/src/msn_misc.cpp @@ -122,7 +122,7 @@ void CMsnProto::InitCustomFolders(void) if (InitCstFldRan) return;
TCHAR folder[MAX_PATH];
- mir_sntprintf(folder, _countof(folder), _T("%%miranda_avatarcache%%\\%S"), m_szModuleName);
+ mir_sntprintf(folder, _T("%%miranda_avatarcache%%\\%S"), m_szModuleName);
hCustomSmileyFolder = FoldersRegisterCustomPathT(LPGEN("Custom Smileys"), m_szModuleName, folder, m_tszUserName);
InitCstFldRan = true;
@@ -541,7 +541,7 @@ void ThreadData::sendCaps(void) char mversion[100], capMsg[1000];
CallService(MS_SYSTEM_GETVERSIONTEXT, sizeof(mversion), (LPARAM)mversion);
- mir_snprintf(capMsg, _countof(capMsg),
+ mir_snprintf(capMsg,
"Content-Type: text/x-clientcaps\r\n\r\n"
"Client-Name: Miranda NG %s (MSN v.%s)\r\n",
mversion, __VERSION_STRING_DOTS);
@@ -586,7 +586,7 @@ int ThreadData::sendRawMessage(int msgType, const char* data, int datLen) void CMsnProto::MSN_SendTyping(ThreadData* info, const char* email, int netId, bool bTyping)
{
char tCommand[1024];
- mir_snprintf(tCommand, _countof(tCommand),
+ mir_snprintf(tCommand,
"Messaging: 2.0\r\n"
"Message-Type: %s\r\n"
"Content-Type: Application/Message\r\n"
@@ -632,7 +632,7 @@ void CMsnProto::MSN_SendStatusMessage(const char*) size_t sz;
char szMsg[2048];
if (msnCurrentMedia.cbSize == 0) {
- sz = mir_snprintf(szMsg, _countof(szMsg), "<Data><PSM>%s</PSM><CurrentMedia></CurrentMedia><MachineGuid>%s</MachineGuid>"
+ sz = mir_snprintf(szMsg, "<Data><PSM>%s</PSM><CurrentMedia></CurrentMedia><MachineGuid>%s</MachineGuid>"
"<DDP></DDP><SignatureSound></SignatureSound><Scene></Scene><ColorScheme></ColorScheme></Data>",
msgEnc, MyOptions.szMachineGuid);
}
@@ -799,7 +799,7 @@ void CMsnProto::MSN_SetServerStatus(int newStatus) char szMsg[2048];
#ifdef OBSOLETE
if (m_iStatus < ID_STATUS_ONLINE) {
- int sz = mir_snprintf(szMsg, _countof(szMsg),
+ int sz = mir_snprintf(szMsg,
"<EndpointData><Capabilities>%u:%u</Capabilities></EndpointData>", myFlags, myFlagsEx);
msnNsThread->sendPacket("UUX", "%d\r\n%s", sz, szMsg);
@@ -826,7 +826,7 @@ void CMsnProto::MSN_SetServerStatus(int newStatus) }
char** msgptr = GetStatusMsgLoc(newStatus);
- int sz = mir_snprintf(szMsg, _countof(szMsg),
+ int sz = mir_snprintf(szMsg,
"<user>"
"<sep n=\"PE\" epid=\"%s\"><VER>%s</VER><TYP>11</TYP><Capabilities>0:0</Capabilities></sep>"
"<s n=\"IM\"><Status>%s</Status></s>"
@@ -859,7 +859,7 @@ void CMsnProto::MSN_SetServerStatus(int newStatus) // TODO: Send, MSN_SendStatusMessage anpassen.
#ifdef OBSOLETE
- int sz = mir_snprintf(szMsg, _countof(szMsg),
+ int sz = mir_snprintf(szMsg,
"<PrivateEndpointData>"
"<EpName>%s</EpName>"
"<Idle>%s</Idle>"
@@ -1068,7 +1068,7 @@ void CALLBACK sttMainThreadCallback(PVOID dwParam) if ((iserr && !pud->proto->MyOptions.ShowErrorsAsPopups) || !ServiceExists(MS_POPUP_ADDPOPUPCLASS)) {
if (pud->flags & MSN_ALLOW_MSGBOX) {
TCHAR szMsg[MAX_SECONDLINE + MAX_CONTACTNAME];
- mir_sntprintf(szMsg, _countof(szMsg), _T("%s:\n%s"), pud->title, pud->text);
+ mir_sntprintf(szMsg, _T("%s:\n%s"), pud->title, pud->text);
int ret = MessageBox(NULL, szMsg, TranslateT("MSN Protocol"),
MB_YESNO | (iserr ? MB_ICONERROR : MB_ICONINFORMATION));
if (ret == IDYES)
@@ -1404,7 +1404,7 @@ void MSN_MakeDigest(const char* chl, char* dgst) md5hash[i] &= 0x7FFFFFFF;
char chlString[128];
- mir_snprintf(chlString, _countof(chlString), "%s%s00000000", chl, msnProductID);
+ mir_snprintf(chlString, "%s%s00000000", chl, msnProductID);
chlString[(mir_strlen(chl) + mir_strlen(msnProductID) + 7) & 0xF8] = 0;
LONGLONG high = 0, low = 0;
diff --git a/protocols/MSN/src/msn_opts.cpp b/protocols/MSN/src/msn_opts.cpp index 6b267e22cf..648b4af59f 100644 --- a/protocols/MSN/src/msn_opts.cpp +++ b/protocols/MSN/src/msn_opts.cpp @@ -53,7 +53,7 @@ void MsnInitIcons(void) HICON LoadIconEx(const char* name, bool big)
{
char szSettingName[100];
- mir_snprintf(szSettingName, _countof(szSettingName), "MSN_%s", name);
+ mir_snprintf(szSettingName, "MSN_%s", name);
return IcoLib_GetIcon(szSettingName, big);
}
@@ -69,7 +69,7 @@ HANDLE GetIconHandle(int iconId) void ReleaseIconEx(const char* name, bool big)
{
char szSettingName[100];
- mir_snprintf(szSettingName, _countof(szSettingName), "MSN_%s", name);
+ mir_snprintf(szSettingName, "MSN_%s", name);
IcoLib_Release(szSettingName, big);
}
@@ -204,7 +204,7 @@ LBL_Continue: if (strchr(szFile, ' ') != NULL) {
char tmpBuf[MAX_PATH + 2];
- mir_snprintf(tmpBuf, _countof(tmpBuf), "\"%s\"", szFile);
+ mir_snprintf(tmpBuf, "\"%s\"", szFile);
mir_strcpy(szFile, tmpBuf);
}
diff --git a/protocols/MSN/src/msn_p2p.cpp b/protocols/MSN/src/msn_p2p.cpp index dc965db7dd..c1676a91de 100644 --- a/protocols/MSN/src/msn_p2p.cpp +++ b/protocols/MSN/src/msn_p2p.cpp @@ -1224,7 +1224,7 @@ void CMsnProto::p2p_InitFileTransfer( ft->std.totalFiles = 1;
TCHAR tComment[40];
- mir_sntprintf(tComment, _countof(tComment), TranslateT("%I64u bytes"), ft->std.currentFileSize);
+ mir_sntprintf(tComment, TranslateT("%I64u bytes"), ft->std.currentFileSize);
PROTORECVFILET pre = { 0 };
pre.dwFlags = PRFF_TCHAR;
@@ -1396,8 +1396,7 @@ void CMsnProto::p2p_startConnect(const char* wlid, const char* szCallID, const c newThread->mType = SERVER_P2P_DIRECT;
newThread->mInitialContactWLID = mir_strdup(wlid);
strncpy_s(newThread->mCookie, szCallID, _TRUNCATE);
- mir_snprintf(newThread->mServer, _countof(newThread->mServer),
- ipv6 ? "[%s]:%s" : "%s:%s", pAddrTokBeg, pPortTokBeg);
+ mir_snprintf(newThread->mServer, ipv6 ? "[%s]:%s" : "%s:%s", pAddrTokBeg, pPortTokBeg);
newThread->startThread(&CMsnProto::p2p_fileActiveThread, this);
@@ -1739,7 +1738,7 @@ void CMsnProto::p2p_processMsgV2(ThreadData* info, char* msgbody, const char* wl if (hdrdata.mRemSize || hdrdata.mTFCode == 0) {
char msgid[128];
- mir_snprintf(msgid, _countof(msgid), "%s_%08x", wlid, hdrdata.mPacketNum);
+ mir_snprintf(msgid, "%s_%08x", wlid, hdrdata.mPacketNum);
int idx;
if (hdrdata.mTFCode == 0x01) {
@@ -1830,7 +1829,7 @@ void CMsnProto::p2p_processMsg(ThreadData* info, char* msgbody, const char* wlid if (hdrdata.mPacketLen < hdrdata.mTotalSize) {
char msgid[128];
- mir_snprintf(msgid, _countof(msgid), "%s_%08x", wlid, hdrdata.mID);
+ mir_snprintf(msgid, "%s_%08x", wlid, hdrdata.mID);
int idx = addCachedMsg(msgid, msgbody, (size_t)hdrdata.mOffset, hdrdata.mPacketLen,
(size_t)hdrdata.mTotalSize, false);
@@ -2094,7 +2093,7 @@ void CMsnProto::p2p_invite(unsigned iAppID, filetransfer* ft, const char *wlid) if (ft->p2p_isV2) {
if (cont->places.getCount() && cont->places[0].cap1 & cap_SupportsP2PBootstrap) {
char wlid[128];
- mir_snprintf(wlid, _countof(wlid),
+ mir_snprintf(wlid,
mir_strcmp(cont->places[0].id, sttVoidUid) ? "%s;%s" : "%s",
cont->email, cont->places[0].id);
@@ -2145,7 +2144,7 @@ void CMsnProto::p2p_invite(unsigned iAppID, filetransfer* ft, const char *wlid) if (ft->p2p_isV2 && ft->std.currentFileNumber == 0) {
for (int i = 0; i < cont->places.getCount(); ++i) {
char wlid[128];
- mir_snprintf(wlid, _countof(wlid),
+ mir_snprintf(wlid,
mir_strcmp(cont->places[i].id, sttVoidUid) ? "%s;%s" : "%s",
cont->email, cont->places[i].id);
diff --git a/protocols/MSN/src/msn_proto.cpp b/protocols/MSN/src/msn_proto.cpp index 5c9955d37b..69bd39aa5d 100644 --- a/protocols/MSN/src/msn_proto.cpp +++ b/protocols/MSN/src/msn_proto.cpp @@ -128,7 +128,7 @@ CMsnProto::CMsnProto(const char* aProtoName, const TCHAR* aUserName) : nlu1.szSettingsModule = szDbsettings;
nlu1.ptszDescriptiveName = szBuffer;
- mir_snprintf(szDbsettings, _countof(szDbsettings), "%s_HTTPS", m_szModuleName);
+ mir_snprintf(szDbsettings, "%s_HTTPS", m_szModuleName);
mir_sntprintf(szBuffer, TranslateT("%s plugin HTTPS connections"), m_tszUserName);
hNetlibUserHttps = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu1);
@@ -492,7 +492,7 @@ void __cdecl CMsnProto::MsnFileAckThread(void* arg) filetransfer* ft = (filetransfer*)arg;
TCHAR filefull[MAX_PATH];
- mir_sntprintf(filefull, _countof(filefull), _T("%s\\%s"), ft->std.tszWorkingDir, ft->std.tszCurrentFile);
+ mir_sntprintf(filefull, _T("%s\\%s"), ft->std.tszWorkingDir, ft->std.tszCurrentFile);
replaceStrT(ft->std.tszCurrentFile, filefull);
ResetEvent(ft->hResumeEvt);
@@ -1224,7 +1224,7 @@ int __cdecl CMsnProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM l case EV_PROTO_ONERASE:
char szDbsettings[64];
- mir_snprintf(szDbsettings, _countof(szDbsettings), "%s_HTTPS", m_szModuleName);
+ mir_snprintf(szDbsettings, "%s_HTTPS", m_szModuleName);
CallService(MS_DB_MODULE_DELETE, 0, (LPARAM)szDbsettings);
break;
diff --git a/protocols/MSN/src/msn_soapab.cpp b/protocols/MSN/src/msn_soapab.cpp index c9404004f9..a6cc884788 100644 --- a/protocols/MSN/src/msn_soapab.cpp +++ b/protocols/MSN/src/msn_soapab.cpp @@ -74,8 +74,8 @@ ezxml_t CMsnProto::abSoapHdr(const char* service, const char* scenario, ezxml_t& ezxml_t CMsnProto::getSoapResponse(ezxml_t bdy, const char* service)
{
char resp1[40], resp2[40];
- mir_snprintf(resp1, _countof(resp1), "%sResponse", service);
- mir_snprintf(resp2, _countof(resp2), "%sResult", service);
+ mir_snprintf(resp1, "%sResponse", service);
+ mir_snprintf(resp2, "%sResult", service);
ezxml_t res = ezxml_get(bdy, "soap:Body", 0, resp1, 0, resp2, -1);
if (res == NULL)
@@ -93,7 +93,7 @@ ezxml_t CMsnProto::getSoapFault(ezxml_t bdy, bool err) void CMsnProto::UpdateABHost(const char* service, const char* url)
{
char hostname[128];
- mir_snprintf(hostname, _countof(hostname), "ABHost-%s", service);
+ mir_snprintf(hostname, "ABHost-%s", service);
if (url)
setString(hostname, url);
@@ -112,7 +112,7 @@ void CMsnProto::UpdateABCacheKey(ezxml_t bdy, bool isSharing) char* CMsnProto::GetABHost(const char* service, bool isSharing)
{
char hostname[128];
- mir_snprintf(hostname, _countof(hostname), "ABHost-%s", service);
+ mir_snprintf(hostname, "ABHost-%s", service);
char* host = (char*)mir_alloc(256);
if (db_get_static(NULL, m_szModuleName, hostname, host, 256)) {
@@ -265,7 +265,7 @@ bool CMsnProto::MSN_SharingFindMembership(bool deltas, bool allowRecurse) }
else if (mir_strcmp(szType, "Phone") == 0) {
netId = NETID_MOB;
- mir_snprintf(email, _countof(email), "tel:%s", ezxml_txt(ezxml_child(memb, "PhoneNumber")));
+ mir_snprintf(email, "tel:%s", ezxml_txt(ezxml_child(memb, "PhoneNumber")));
szEmail = email;
}
else if (mir_strcmp(szType, "Email") == 0) {
@@ -656,7 +656,7 @@ bool CMsnProto::MSN_ABFind(const char* szMethod, const char* szGuid, bool deltas szMsgUsr = ezxml_txt(ezxml_child(phn, "isMessengerEnabled"));
if (mir_strcmp(szMsgUsr, "true") == 0) {
szEmail = ezxml_txt(ezxml_child(phn, "number"));
- mir_snprintf(email, _countof(email), "tel:%s", szEmail);
+ mir_snprintf(email, "tel:%s", szEmail);
szEmail = email;
netId = NETID_MOB;
break;
@@ -1551,7 +1551,7 @@ void CMsnProto::MSN_ABUpdateDynamicItem(bool allowRecurse) tm *tmst = gmtime(&timer);
char tmstr[64];
- mir_snprintf(tmstr, _countof(tmstr), "%04u-%02u-%02uT%02u:%02u:%02uZ",
+ mir_snprintf(tmstr, "%04u-%02u-%02uT%02u:%02u:%02uZ",
tmst->tm_year + 1900, tmst->tm_mon + 1, tmst->tm_mday,
tmst->tm_hour, tmst->tm_min, tmst->tm_sec);
diff --git a/protocols/MSN/src/msn_soapstore.cpp b/protocols/MSN/src/msn_soapstore.cpp index fc8a5b96f2..8a86cd0635 100644 --- a/protocols/MSN/src/msn_soapstore.cpp +++ b/protocols/MSN/src/msn_soapstore.cpp @@ -71,7 +71,7 @@ ezxml_t CMsnProto::storeSoapHdr(const char* service, const char* scenario, ezxml char* CMsnProto::GetStoreHost(const char* service)
{
char hostname[128];
- mir_snprintf(hostname, _countof(hostname), "StoreHost-%s", service);
+ mir_snprintf(hostname, "StoreHost-%s", service);
char* host = (char*)mir_alloc(256);
if (db_get_static(NULL, m_szModuleName, hostname, host, 256) || !*host)
@@ -83,7 +83,7 @@ char* CMsnProto::GetStoreHost(const char* service) void CMsnProto::UpdateStoreHost(const char* service, const char* url)
{
char hostname[128];
- mir_snprintf(hostname, _countof(hostname), "StoreHost-%s", service);
+ mir_snprintf(hostname, "StoreHost-%s", service);
setString(hostname, url);
}
diff --git a/protocols/Omegle/src/communication.cpp b/protocols/Omegle/src/communication.cpp index ce0afcc440..9b0ba9f3d5 100644 --- a/protocols/Omegle/src/communication.cpp +++ b/protocols/Omegle/src/communication.cpp @@ -551,7 +551,7 @@ bool Omegle_client::events() st.cbSize = sizeof(st);
// st.hIcon = IcoLib_GetIconByHandle(GetIconHandle("typing_on")); // TODO: typing icon
- mir_sntprintf(st.tszText, _countof(st.tszText), TranslateT("%s is typing."), TranslateT("Stranger"));
+ mir_sntprintf(st.tszText, TranslateT("%s is typing."), TranslateT("Stranger"));
CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)parent->GetChatHandle(), (LPARAM)&st);
}
@@ -566,7 +566,7 @@ bool Omegle_client::events() st.cbSize = sizeof(st);
// st.hIcon = IcoLib_GetIconByHandle(GetIconHandle("typing_off")); // TODO: typing icon
- mir_sntprintf(st.tszText, _countof(st.tszText), TranslateT("%s stopped typing."), TranslateT("Stranger"));
+ mir_sntprintf(st.tszText, TranslateT("%s stopped typing."), TranslateT("Stranger"));
CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)parent->GetChatHandle(), (LPARAM)&st);
}
diff --git a/protocols/Omegle/src/proto.cpp b/protocols/Omegle/src/proto.cpp index 45686560e5..3cb3bb9d2a 100644 --- a/protocols/Omegle/src/proto.cpp +++ b/protocols/Omegle/src/proto.cpp @@ -27,11 +27,11 @@ OmegleProto::OmegleProto(const char* proto_name, const TCHAR* username) : {
this->facy.parent = this;
- this->signon_lock_ = CreateMutex( NULL, FALSE, NULL );
- this->log_lock_ = CreateMutex( NULL, FALSE, NULL );
- this->facy.send_message_lock_ = CreateMutex( NULL, FALSE, NULL );
- this->facy.connection_lock_ = CreateMutex( NULL, FALSE, NULL );
- this->events_loop_lock_ = CreateMutex( NULL, FALSE, NULL );
+ this->signon_lock_ = CreateMutex(NULL, FALSE, NULL);
+ this->log_lock_ = CreateMutex(NULL, FALSE, NULL);
+ this->facy.send_message_lock_ = CreateMutex(NULL, FALSE, NULL);
+ this->facy.connection_lock_ = CreateMutex(NULL, FALSE, NULL);
+ this->events_loop_lock_ = CreateMutex(NULL, FALSE, NULL);
// Group chats
CreateProtoService(PS_JOINCHAT, &OmegleProto::OnJoinChat);
@@ -44,12 +44,12 @@ OmegleProto::OmegleProto(const char* proto_name, const TCHAR* username) : // Create standard network connection
TCHAR descr[512];
- NETLIBUSER nlu = {sizeof(nlu)};
+ NETLIBUSER nlu = { sizeof(nlu) };
nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR;
nlu.szSettingsModule = m_szModuleName;
- mir_sntprintf(descr,_countof(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);
+ m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
if (m_hNetlibUser == NULL) {
TCHAR error[200];
mir_sntprintf(error, TranslateT("Unable to initialize Netlib for %s."), m_tszUserName);
@@ -58,32 +58,32 @@ OmegleProto::OmegleProto(const char* proto_name, const TCHAR* username) : facy.set_handle(m_hNetlibUser);
- SkinAddNewSoundExT( "StrangerTyp", m_tszUserName, LPGENT( "Stranger typing" ));
- SkinAddNewSoundExT( "StrangerTypStop", m_tszUserName, LPGENT( "Stranger stopped typing" ));
- SkinAddNewSoundExT( "StrangerChange", m_tszUserName, LPGENT( "Changing stranger" ));
+ SkinAddNewSoundExT("StrangerTyp", m_tszUserName, LPGENT("Stranger typing"));
+ SkinAddNewSoundExT("StrangerTypStop", m_tszUserName, LPGENT("Stranger stopped typing"));
+ SkinAddNewSoundExT("StrangerChange", m_tszUserName, LPGENT("Changing stranger"));
}
-OmegleProto::~OmegleProto( )
+OmegleProto::~OmegleProto()
{
- Netlib_CloseHandle( m_hNetlibUser );
-
- WaitForSingleObject( this->signon_lock_, IGNORE );
- WaitForSingleObject( this->log_lock_, IGNORE );
- WaitForSingleObject( this->facy.send_message_lock_, IGNORE );
- WaitForSingleObject( this->events_loop_lock_, IGNORE );
-
- CloseHandle( this->signon_lock_ );
- CloseHandle( this->log_lock_ );
- CloseHandle( this->facy.send_message_lock_ );
- CloseHandle( this->events_loop_lock_ );
- CloseHandle( this->facy.connection_lock_ );
+ Netlib_CloseHandle(m_hNetlibUser);
+
+ WaitForSingleObject(this->signon_lock_, IGNORE);
+ WaitForSingleObject(this->log_lock_, IGNORE);
+ WaitForSingleObject(this->facy.send_message_lock_, IGNORE);
+ WaitForSingleObject(this->events_loop_lock_, IGNORE);
+
+ CloseHandle(this->signon_lock_);
+ CloseHandle(this->log_lock_);
+ CloseHandle(this->facy.send_message_lock_);
+ CloseHandle(this->events_loop_lock_);
+ CloseHandle(this->facy.connection_lock_);
}
//////////////////////////////////////////////////////////////////////////////
DWORD_PTR OmegleProto::GetCaps(int type, MCONTACT)
{
- switch(type) {
+ switch (type) {
case PFLAGNUM_1:
return PF1_CHAT;
case PFLAGNUM_2:
@@ -93,7 +93,7 @@ DWORD_PTR OmegleProto::GetCaps(int type, MCONTACT) case PFLAG_MAXLENOFMESSAGE:
return OMEGLE_MESSAGE_LIMIT;
case PFLAG_UNIQUEIDTEXT:
- return (DWORD_PTR) Translate("Visible name");
+ return (DWORD_PTR)Translate("Visible name");
case PFLAG_UNIQUEIDSETTING:
return (DWORD_PTR) "Nick";
}
@@ -102,10 +102,10 @@ DWORD_PTR OmegleProto::GetCaps(int type, MCONTACT) //////////////////////////////////////////////////////////////////////////////
-int OmegleProto::SetStatus( int new_status )
+int OmegleProto::SetStatus(int new_status)
{
// Routing statuses not supported by Omegle
- switch ( new_status ) {
+ switch (new_status) {
case ID_STATUS_OFFLINE:
case ID_STATUS_CONNECTING:
new_status = ID_STATUS_OFFLINE;
@@ -117,44 +117,39 @@ int OmegleProto::SetStatus( int new_status ) m_iDesiredStatus = new_status;
- if ( new_status == m_iStatus)
- {
+ if (new_status == m_iStatus) {
return 0;
}
- if ( m_iStatus == ID_STATUS_CONNECTING && new_status != ID_STATUS_OFFLINE )
- {
+ if (m_iStatus == ID_STATUS_CONNECTING && new_status != ID_STATUS_OFFLINE) {
return 0;
}
- if ( new_status == ID_STATUS_OFFLINE )
- {
- ForkThread( &OmegleProto::SignOff, this );
+ if (new_status == ID_STATUS_OFFLINE) {
+ ForkThread(&OmegleProto::SignOff, this);
}
- else
- {
- ForkThread( &OmegleProto::SignOn, this );
+ else {
+ ForkThread(&OmegleProto::SignOn, this);
}
return 0;
}
//////////////////////////////////////////////////////////////////////////////
-int OmegleProto::OnEvent(PROTOEVENTTYPE event,WPARAM wParam,LPARAM lParam)
+int OmegleProto::OnEvent(PROTOEVENTTYPE event, WPARAM wParam, LPARAM lParam)
{
- switch(event)
- {
+ switch (event) {
case EV_PROTO_ONLOAD:
- return OnModulesLoaded(wParam,lParam);
+ return OnModulesLoaded(wParam, lParam);
case EV_PROTO_ONEXIT:
- return OnPreShutdown (wParam,lParam);
+ return OnPreShutdown(wParam, lParam);
case EV_PROTO_ONOPTIONS:
- return OnOptionsInit (wParam,lParam);
+ return OnOptionsInit(wParam, lParam);
case EV_PROTO_ONCONTACTDELETED:
- return OnContactDeleted(wParam,lParam);
+ return OnContactDeleted(wParam, lParam);
}
return 1;
@@ -165,21 +160,21 @@ int OmegleProto::OnEvent(PROTOEVENTTYPE event,WPARAM wParam,LPARAM lParam) INT_PTR OmegleProto::SvcCreateAccMgrUI(WPARAM, LPARAM lParam)
{
- return (INT_PTR)CreateDialogParam(g_hInstance,MAKEINTRESOURCE(IDD_OmegleACCOUNT),
+ return (INT_PTR)CreateDialogParam(g_hInstance, MAKEINTRESOURCE(IDD_OmegleACCOUNT),
(HWND)lParam, OmegleAccountProc, (LPARAM)this);
}
int OmegleProto::OnModulesLoaded(WPARAM, LPARAM)
{
// Register group chat
- GCREGISTER gcr = {sizeof(gcr)};
+ GCREGISTER gcr = { sizeof(gcr) };
gcr.dwFlags = 0; //GC_TYPNOTIF; //GC_ACKMSG;
gcr.pszModule = m_szModuleName;
gcr.ptszDispName = m_tszUserName;
gcr.iMaxText = OMEGLE_MESSAGE_LIMIT;
gcr.nColors = 0;
gcr.pColors = NULL;
- CallService(MS_GC_REGISTER,0,reinterpret_cast<LPARAM>(&gcr));
+ CallService(MS_GC_REGISTER, 0, reinterpret_cast<LPARAM>(&gcr));
return 0;
}
@@ -187,23 +182,23 @@ int OmegleProto::OnModulesLoaded(WPARAM, LPARAM) int OmegleProto::OnOptionsInit(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { 0 };
- odp.hInstance = g_hInstance;
- odp.ptszTitle = m_tszUserName;
+ odp.hInstance = g_hInstance;
+ odp.ptszTitle = m_tszUserName;
odp.dwInitParam = LPARAM(this);
- odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE;
- odp.position = 271828;
- odp.ptszGroup = LPGENT("Network");
- odp.ptszTab = LPGENT("Account");
+ odp.position = 271828;
+ odp.ptszGroup = LPGENT("Network");
+ odp.ptszTab = LPGENT("Account");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
- odp.pfnDlgProc = OmegleOptionsProc;
+ odp.pfnDlgProc = OmegleOptionsProc;
Options_AddPage(wParam, &odp);
return 0;
}
int OmegleProto::OnPreShutdown(WPARAM, LPARAM)
{
- SetStatus( ID_STATUS_OFFLINE );
+ SetStatus(ID_STATUS_OFFLINE);
return 0;
}
diff --git a/protocols/Sametime/src/conference.cpp b/protocols/Sametime/src/conference.cpp index 4aaf949a27..4c9ce74460 100644 --- a/protocols/Sametime/src/conference.cpp +++ b/protocols/Sametime/src/conference.cpp @@ -410,7 +410,7 @@ INT_PTR CSametimeProto::onMenuCreateChat(WPARAM wParam, LPARAM lParam) if (my_login_info && GetAwareIdFromContact(hContact, &id_block)) {
TCHAR title[512];
TCHAR* ts = mir_utf8decodeT(my_login_info->user_name);
- mir_sntprintf(title, _countof(title), TranslateT("%s's conference"), ts);
+ mir_sntprintf(title, TranslateT("%s's conference"), ts);
mir_free(ts);
idb.user = id_block.user;
diff --git a/protocols/Sametime/src/files.cpp b/protocols/Sametime/src/files.cpp index 8393eb31a8..53141f1587 100644 --- a/protocols/Sametime/src/files.cpp +++ b/protocols/Sametime/src/files.cpp @@ -33,7 +33,7 @@ void mwFileTransfer_offered(mwFileTransfer* ft) TCHAR descriptionT[512];
if (message) {
TCHAR* messageT = mir_utf8decodeT(message);
- mir_sntprintf(descriptionT, _countof(descriptionT), _T("%s - %s"), filenameT, messageT);
+ mir_sntprintf(descriptionT, _T("%s - %s"), filenameT, messageT);
mir_free(messageT);
} else
_tcsncpy_s(descriptionT, filenameT, _TRUNCATE);
diff --git a/protocols/Sametime/src/messaging.cpp b/protocols/Sametime/src/messaging.cpp index 46540ad090..0a7f8a24f2 100644 --- a/protocols/Sametime/src/messaging.cpp +++ b/protocols/Sametime/src/messaging.cpp @@ -98,7 +98,7 @@ void mwIm_place_invite(struct mwConversation* conv, const char* message, const c TCHAR* tszMessage = mir_utf8decodeT(message);
TCHAR msg[512];
- mir_sntprintf(msg, _countof(msg), TranslateT("SERVICE NOT IMPLEMENTED. %s"), tszMessage);
+ mir_sntprintf(msg, TranslateT("SERVICE NOT IMPLEMENTED. %s"), tszMessage);
proto->showPopup(msg, SAMETIME_POPUP_INFO);
mir_free(tszMessage);
diff --git a/protocols/Sametime/src/options.cpp b/protocols/Sametime/src/options.cpp index d8c3c33bbc..6d47ca05fd 100644 --- a/protocols/Sametime/src/options.cpp +++ b/protocols/Sametime/src/options.cpp @@ -103,14 +103,14 @@ static INT_PTR CALLBACK DlgProcOptNet(HWND hwndDlg, UINT msg, WPARAM wParam, LPA WORD client_ver = proto->GetClientVersion();
if (client_ver) {
TCHAR verbuf[100];
- mir_sntprintf(verbuf, _countof(verbuf), TranslateT("Client protocol version: %03d.%03d"), (client_ver & 0xFF00) >> 8, client_ver & 0xFF);
+ mir_sntprintf(verbuf, TranslateT("Client protocol version: %03d.%03d"), (client_ver & 0xFF00) >> 8, client_ver & 0xFF);
SetDlgItemText(hwndDlg, IDC_ST_CLIENTVER, verbuf);
}
WORD server_ver = proto->GetServerVersion();
if (server_ver) {
TCHAR verbuf[100];
- mir_sntprintf(verbuf, _countof(verbuf), TranslateT("Server protocol version: %03d.%03d"), (server_ver & 0xFF00) >> 8, server_ver & 0xFF);
+ mir_sntprintf(verbuf, TranslateT("Server protocol version: %03d.%03d"), (server_ver & 0xFF00) >> 8, server_ver & 0xFF);
SetDlgItemText(hwndDlg, IDC_ST_SERVERVER, verbuf);
}
diff --git a/protocols/Sametime/src/sametime.cpp b/protocols/Sametime/src/sametime.cpp index 863430b20d..3f04f7ee22 100644 --- a/protocols/Sametime/src/sametime.cpp +++ b/protocols/Sametime/src/sametime.cpp @@ -108,14 +108,14 @@ HANDLE GetIconHandle(int iconId) HICON LoadIconEx(const char* name, bool big)
{
char szSettingName[100];
- mir_snprintf(szSettingName, _countof(szSettingName), "%s_%s", "SAMETIME", name);
+ mir_snprintf(szSettingName, "%s_%s", "SAMETIME", name);
return IcoLib_GetIcon(szSettingName, big);
}
void ReleaseIconEx(const char* name, bool big)
{
char szSettingName[100];
- mir_snprintf(szSettingName, _countof(szSettingName), "%s_%s", "SAMETIME", name);
+ mir_snprintf(szSettingName, "%s_%s", "SAMETIME", name);
IcoLib_Release(szSettingName, big);
}
diff --git a/protocols/Sametime/src/sametime_proto.cpp b/protocols/Sametime/src/sametime_proto.cpp index 1e568c1a31..5a9b5cd2d5 100644 --- a/protocols/Sametime/src/sametime_proto.cpp +++ b/protocols/Sametime/src/sametime_proto.cpp @@ -15,7 +15,7 @@ CSametimeProto::CSametimeProto(const char* pszProtoName, const TCHAR* tszUserNam {
// Register m_hNetlibUser user
TCHAR name[128];
- mir_sntprintf(name, _countof(name), TranslateT("%s connection"), m_tszUserName);
+ mir_sntprintf(name, TranslateT("%s connection"), m_tszUserName);
NETLIBUSER nlu = { 0 };
nlu.cbSize = sizeof(nlu);
nlu.flags = NUF_TCHAR | NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS;
@@ -45,7 +45,7 @@ CSametimeProto::CSametimeProto(const char* pszProtoName, const TCHAR* tszUserNam RegisterPopups();
InitAwayMsg();
- mir_snprintf(szProtoGroups, _countof(szProtoGroups), "%s_GROUPS", m_szModuleName);
+ mir_snprintf(szProtoGroups, "%s_GROUPS", m_szModuleName);
m_iStatus = ID_STATUS_OFFLINE;
previous_status = ID_STATUS_OFFLINE;
diff --git a/protocols/Sametime/src/sametime_session.cpp b/protocols/Sametime/src/sametime_session.cpp index abd9a0b508..a0e6eb8bdf 100644 --- a/protocols/Sametime/src/sametime_session.cpp +++ b/protocols/Sametime/src/sametime_session.cpp @@ -155,7 +155,7 @@ void __cdecl SessionAnnounce(struct mwSession* session, struct mwLoginInfo* from TCHAR stzFromBuff[256];
stzFrom = mir_utf8decodeT(from->user_name);
stzText = mir_utf8decodeT(text);
- mir_sntprintf(stzFromBuff, _countof(stzFromBuff), TranslateT("Session announcement - from '%s'"), stzFrom);
+ mir_sntprintf(stzFromBuff, TranslateT("Session announcement - from '%s'"), stzFrom);
MessageBox(0, TranslateTS(stzText), stzFromBuff, MB_OK);
mir_free(stzText);
mir_free(stzFrom);
diff --git a/protocols/Sametime/src/utils.cpp b/protocols/Sametime/src/utils.cpp index 8bf46c72d1..346ccd5027 100644 --- a/protocols/Sametime/src/utils.cpp +++ b/protocols/Sametime/src/utils.cpp @@ -40,8 +40,8 @@ void CSametimeProto::RegisterPopups() puc.ptszDescription = szDescr;
puc.pszName = szName;
- mir_snprintf(szName, _countof(szName), "%s_%s", m_szModuleName, "Notify");
- mir_sntprintf(szDescr, _countof(szDescr), _T("%s/%s"), m_tszUserName, TranslateT("Notification"));
+ mir_snprintf(szName, "%s_%s", m_szModuleName, "Notify");
+ mir_sntprintf(szDescr, _T("%s/%s"), m_tszUserName, TranslateT("Notification"));
puc.hIcon = CopyIcon(LoadIconEx("notify", FALSE));
ReleaseIconEx("notify", FALSE);
puc.iSeconds = 8;
@@ -49,8 +49,8 @@ void CSametimeProto::RegisterPopups() puc.colorText = GetSysColor(COLOR_WINDOWTEXT);
hPopupNotify = Popup_RegisterClass(&puc);
- mir_snprintf(szName, _countof(szName), "%s_%s", m_szModuleName, "Error");
- mir_sntprintf(szDescr, _countof(szDescr), _T("%s/%s"), m_tszUserName, TranslateT("Error"));
+ mir_snprintf(szName, "%s_%s", m_szModuleName, "Error");
+ mir_sntprintf(szDescr, _T("%s/%s"), m_tszUserName, TranslateT("Error"));
puc.hIcon = CopyIcon(LoadIconEx("error", FALSE));
ReleaseIconEx("error", FALSE);
puc.iSeconds = 10;
@@ -89,9 +89,9 @@ void CALLBACK sttMainThreadCallback(PVOID dwParam) ppd.ptszTitle = puData->title;
ppd.ptszText = puData->text;
if (puData->flag == SAMETIME_POPUP_ERROR)
- mir_snprintf(szName, _countof(szName), "%s_%s", proto->m_szModuleName, "Error");
+ mir_snprintf(szName, "%s_%s", proto->m_szModuleName, "Error");
else
- mir_snprintf(szName, _countof(szName), "%s_%s", proto->m_szModuleName, "Notify");
+ mir_snprintf(szName, "%s_%s", proto->m_szModuleName, "Notify");
ppd.pszClassName = szName;
CallService(MS_POPUP_ADDPOPUPCLASS, 0, (LPARAM)&ppd);
}
diff --git a/protocols/SkypeWeb/src/http_request.h b/protocols/SkypeWeb/src/http_request.h index 80f301908f..9f25884f6d 100644 --- a/protocols/SkypeWeb/src/http_request.h +++ b/protocols/SkypeWeb/src/http_request.h @@ -277,7 +277,7 @@ public: }
char message[1024];
- mir_snprintf(message, _countof(message), "Send request to %s", szUrl);
+ mir_snprintf(message, "Send request to %s", szUrl);
CallService(MS_NETLIB_LOG, (WPARAM)hConnection, (LPARAM)&message);
return (NETLIBHTTPREQUEST*)CallService(MS_NETLIB_HTTPTRANSACTION, (WPARAM)hConnection, (LPARAM)this);
diff --git a/protocols/SkypeWeb/src/skype_icons.cpp b/protocols/SkypeWeb/src/skype_icons.cpp index 228c7876a8..ee5d6d904a 100644 --- a/protocols/SkypeWeb/src/skype_icons.cpp +++ b/protocols/SkypeWeb/src/skype_icons.cpp @@ -44,10 +44,10 @@ void CSkypeProto::InitIcons() sid.pszName = szSettingName;
sid.section.t = szSectionName;
- mir_sntprintf(szSectionName, _countof(szSectionName), _T("%s/%s"), LPGENT("Protocols"), LPGENT(MODULE));
+ mir_sntprintf(szSectionName, _T("%s/%s"), LPGENT("Protocols"), LPGENT(MODULE));
for (int i = 0; i < _countof(Icons); i++)
{
- mir_snprintf(szSettingName, _countof(szSettingName), "%s_%s", MODULE, Icons[i].Name);
+ mir_snprintf(szSettingName, "%s_%s", MODULE, Icons[i].Name);
sid.description.t = Icons[i].Description;
sid.iDefaultIndex = -Icons[i].IconId;
@@ -67,7 +67,7 @@ HANDLE CSkypeProto::GetIconHandle(const char *name) HANDLE CSkypeProto::Skin_GetIconHandle(const char *name)
{
char iconName[100];
- mir_snprintf(iconName, _countof(iconName), "%s_%s", MODULE, name);
+ mir_snprintf(iconName, "%s_%s", MODULE, name);
HANDLE hIcon = IcoLib_GetIconHandle(iconName);
if (hIcon == NULL)
hIcon = GetIconHandle(name);
diff --git a/protocols/SkypeWeb/src/skype_network.cpp b/protocols/SkypeWeb/src/skype_network.cpp index f0f3e2c804..06b7213a88 100644 --- a/protocols/SkypeWeb/src/skype_network.cpp +++ b/protocols/SkypeWeb/src/skype_network.cpp @@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. void CSkypeProto::InitNetwork()
{
TCHAR name[128];
- mir_sntprintf(name, _countof(name), TranslateT("%s connection"), m_tszUserName);
+ mir_sntprintf(name, TranslateT("%s connection"), m_tszUserName);
NETLIBUSER nlu = { 0 };
nlu.cbSize = sizeof(nlu);
nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS | NUF_UNICODE;
diff --git a/protocols/Steam/src/api/friend_list.h b/protocols/Steam/src/api/friend_list.h index 7721f0c921..c16a7d84bf 100644 --- a/protocols/Steam/src/api/friend_list.h +++ b/protocols/Steam/src/api/friend_list.h @@ -20,10 +20,10 @@ public: HttpRequest(REQUEST_POST, STEAM_WEB_URL "/actions/AddFriendAjax")
{
char login[MAX_PATH];
- mir_snprintf(login, _countof(login), "%s||oauth:%s", steamId, token);
+ mir_snprintf(login, "%s||oauth:%s", steamId, token);
char cookie[MAX_PATH];
- mir_snprintf(cookie, _countof(cookie), "steamLogin=%s;sessionid=%s;forceMobile=1", login, sessionId);
+ mir_snprintf(cookie, "steamLogin=%s;sessionid=%s;forceMobile=1", login, sessionId);
char data[128];
mir_snprintf(data, _countof(data),
@@ -44,10 +44,10 @@ public: HttpRequest(REQUEST_POST, STEAM_WEB_URL "/actions/BlockUserAjax")
{
char login[MAX_PATH];
- mir_snprintf(login, _countof(login), "%s||oauth:%s", steamId, token);
+ mir_snprintf(login, "%s||oauth:%s", steamId, token);
char cookie[MAX_PATH];
- mir_snprintf(cookie, _countof(cookie), "steamLogin=%s;sessionid=%s;forceMobile=1", login, sessionId);
+ mir_snprintf(cookie, "steamLogin=%s;sessionid=%s;forceMobile=1", login, sessionId);
char data[128];
mir_snprintf(data, _countof(data),
@@ -68,10 +68,10 @@ public: HttpRequest(REQUEST_POST, STEAM_WEB_URL "/actions/RemoveFriendAjax")
{
char login[MAX_PATH];
- mir_snprintf(login, _countof(login), "%s||oauth:%s", steamId, token);
+ mir_snprintf(login, "%s||oauth:%s", steamId, token);
char cookie[MAX_PATH];
- mir_snprintf(cookie, _countof(cookie), "steamLogin=%s;sessionid=%s;forceMobile=1", login, sessionId);
+ mir_snprintf(cookie, "steamLogin=%s;sessionid=%s;forceMobile=1", login, sessionId);
char data[128];
mir_snprintf(data, _countof(data),
diff --git a/protocols/Steam/src/api/login.h b/protocols/Steam/src/api/login.h index 00392dd34d..331822d260 100644 --- a/protocols/Steam/src/api/login.h +++ b/protocols/Steam/src/api/login.h @@ -8,7 +8,7 @@ public: HttpRequest(REQUEST_POST, STEAM_API_URL "/ISteamWebUserPresenceOAuth/Logon/v0001")
{
char data[256];
- mir_snprintf(data, _countof(data), "access_token=%s&ui_mode=web", token);
+ mir_snprintf(data, "access_token=%s&ui_mode=web", token);
SetData(data, strlen(data));
AddHeader("Content-Type", "application/x-www-form-urlencoded");
@@ -22,7 +22,7 @@ public: HttpRequest(REQUEST_POST, STEAM_API_URL "/ISteamWebUserPresenceOAuth/Logoff/v0001")
{
char data[256];
- mir_snprintf(data, _countof(data), "access_token=%s&umqid=%s", token, umqId);
+ mir_snprintf(data, "access_token=%s&umqid=%s", token, umqId);
SetData(data, strlen(data));
AddHeader("Content-Type", "application/x-www-form-urlencoded");
diff --git a/protocols/Steam/src/api/pending.h b/protocols/Steam/src/api/pending.h index 4e971275b4..b07e14f087 100644 --- a/protocols/Steam/src/api/pending.h +++ b/protocols/Steam/src/api/pending.h @@ -8,13 +8,13 @@ public: HttpRequest(REQUEST_POST, FORMAT, STEAM_WEB_URL "/profiles/%s/home_process", steamId)
{
char login[MAX_PATH];
- mir_snprintf(login, _countof(login), "%s||oauth:%s", steamId, token);
+ mir_snprintf(login, "%s||oauth:%s", steamId, token);
char cookie[MAX_PATH];
- mir_snprintf(cookie, _countof(cookie), "steamLogin=%s;sessionid=%s;forceMobile=1", login, sessionId);
+ mir_snprintf(cookie, "steamLogin=%s;sessionid=%s;forceMobile=1", login, sessionId);
char data[MAX_PATH];
- mir_snprintf(data, _countof(data), "sessionID=%s&id=%s&perform=accept&action=approvePending&itype=friend&json=1&xml=0", sessionId, who);
+ mir_snprintf(data, "sessionID=%s&id=%s&perform=accept&action=approvePending&itype=friend&json=1&xml=0", sessionId, who);
SetData(data, strlen(data));
AddHeader("Cookie", cookie);
@@ -29,13 +29,13 @@ public: HttpRequest(REQUEST_POST, FORMAT, STEAM_WEB_URL "/profiles/%s/home_process", steamId)
{
char login[MAX_PATH];
- mir_snprintf(login, _countof(login), "%s||oauth:%s", steamId, token);
+ mir_snprintf(login, "%s||oauth:%s", steamId, token);
char cookie[MAX_PATH];
- mir_snprintf(cookie, _countof(cookie), "steamLogin=%s;sessionid=%s;forceMobile=1", login, sessionId);
+ mir_snprintf(cookie, "steamLogin=%s;sessionid=%s;forceMobile=1", login, sessionId);
char data[MAX_PATH];
- mir_snprintf(data, _countof(data), "sessionID=%s&id=%s&perform=ignore&action=approvePending&itype=friend&json=1&xml=0", sessionId, who);
+ mir_snprintf(data, "sessionID=%s&id=%s&perform=ignore&action=approvePending&itype=friend&json=1&xml=0", sessionId, who);
SetData(data, strlen(data));
AddHeader("Cookie", cookie);
@@ -50,13 +50,13 @@ public: HttpRequest(REQUEST_POST, FORMAT, STEAM_WEB_URL "/profiles/%s/home_process", steamId)
{
char login[MAX_PATH];
- mir_snprintf(login, _countof(login), "%s||oauth:%s", steamId, token);
+ mir_snprintf(login, "%s||oauth:%s", steamId, token);
char cookie[MAX_PATH];
- mir_snprintf(cookie, _countof(cookie), "steamLogin=%s;sessionid=%s;forceMobile=1", login, sessionId);
+ mir_snprintf(cookie, "steamLogin=%s;sessionid=%s;forceMobile=1", login, sessionId);
char data[MAX_PATH];
- mir_snprintf(data, _countof(data), "sessionID=%s&id=%s&perform=block&action=approvePending&itype=friend&json=1&xml=0", sessionId, who);
+ mir_snprintf(data, "sessionID=%s&id=%s&perform=block&action=approvePending&itype=friend&json=1&xml=0", sessionId, who);
SetData(data, strlen(data));
AddHeader("Cookie", cookie);
diff --git a/protocols/Steam/src/http_request.h b/protocols/Steam/src/http_request.h index 35a6352d42..89e76e8ac2 100644 --- a/protocols/Steam/src/http_request.h +++ b/protocols/Steam/src/http_request.h @@ -131,7 +131,7 @@ public: szUrl = m_url.GetBuffer();
char message[1024];
- mir_snprintf(message, _countof(message), "Send request to %s", szUrl);
+ mir_snprintf(message, "Send request to %s", szUrl);
CallService(MS_NETLIB_LOG, (WPARAM)hConnection, (LPARAM)&message);
NETLIBHTTPREQUEST* response = (NETLIBHTTPREQUEST*)CallService(MS_NETLIB_HTTPTRANSACTION, (WPARAM)hConnection, (LPARAM)this);
diff --git a/protocols/Steam/src/main.cpp b/protocols/Steam/src/main.cpp index 204bdd56db..4010b9e46f 100644 --- a/protocols/Steam/src/main.cpp +++ b/protocols/Steam/src/main.cpp @@ -47,7 +47,7 @@ extern "C" int __declspec(dllexport) Load(void) Proto_RegisterModule(&pd);
char iconName[100];
- mir_snprintf(iconName, _countof(iconName), "%s_%s", MODULE, "gaming");
+ mir_snprintf(iconName, "%s_%s", MODULE, "gaming");
// extra statuses
HookEvent(ME_SKIN2_ICONSCHANGED, OnReloadIcons);
diff --git a/protocols/Steam/src/steam_avatars.cpp b/protocols/Steam/src/steam_avatars.cpp index bd3b14f60e..77382eb5c4 100644 --- a/protocols/Steam/src/steam_avatars.cpp +++ b/protocols/Steam/src/steam_avatars.cpp @@ -3,7 +3,7 @@ TCHAR* CSteamProto::GetAvatarFilePath(MCONTACT hContact)
{
TCHAR path[MAX_PATH];
- mir_sntprintf(path, _countof(path), _T("%s\\%S"), VARST(_T("%miranda_avatarcache%")), m_szModuleName);
+ mir_sntprintf(path, _T("%s\\%S"), VARST(_T("%miranda_avatarcache%")), m_szModuleName);
DWORD dwAttributes = GetFileAttributes(path);
if (dwAttributes == 0xffffffff || (dwAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0)
diff --git a/protocols/Steam/src/steam_contacts.cpp b/protocols/Steam/src/steam_contacts.cpp index 4fee4049ac..3766a81611 100644 --- a/protocols/Steam/src/steam_contacts.cpp +++ b/protocols/Steam/src/steam_contacts.cpp @@ -626,7 +626,7 @@ void CSteamProto::OnAuthRequested(const NETLIBHTTPREQUEST *response, void *arg) lastName = mir_strdup(""); char reason[MAX_PATH]; - mir_snprintf(reason, _countof(reason), Translate("%s has added you to his or her Friend List"), nickName); + mir_snprintf(reason, Translate("%s has added you to his or her Friend List"), nickName); // blob is: 0(DWORD), hContact(DWORD), nick(ASCIIZ), firstName(ASCIIZ), lastName(ASCIIZ), sid(ASCIIZ), reason(ASCIIZ) DWORD cbBlob = (DWORD)(sizeof(DWORD)* 2 + mir_strlen(nickName) + mir_strlen(firstName) + mir_strlen(lastName) + mir_strlen(steamId) + mir_strlen(reason) + 5); diff --git a/protocols/Steam/src/steam_dialogs.cpp b/protocols/Steam/src/steam_dialogs.cpp index be88b7c86e..116d0a48bc 100644 --- a/protocols/Steam/src/steam_dialogs.cpp +++ b/protocols/Steam/src/steam_dialogs.cpp @@ -10,7 +10,7 @@ CSteamPasswordEditor::CSteamPasswordEditor(CSteamProto *proto) void CSteamPasswordEditor::OnInitDialog()
{
char iconName[100];
- mir_snprintf(iconName, _countof(iconName), "%s_%s", MODULE, "main");
+ mir_snprintf(iconName, "%s_%s", MODULE, "main");
SendMessage(m_hwnd, WM_SETICON, ICON_BIG, (LPARAM)IcoLib_GetIcon(iconName, false));
SendMessage(m_hwnd, WM_SETICON, ICON_SMALL, (LPARAM)IcoLib_GetIcon(iconName, true));
@@ -48,7 +48,7 @@ CSteamGuardDialog::CSteamGuardDialog(CSteamProto *proto, const char *domain) void CSteamGuardDialog::OnInitDialog()
{
char iconName[100];
- mir_snprintf(iconName, _countof(iconName), "%s_%s", MODULE, "main");
+ mir_snprintf(iconName, "%s_%s", MODULE, "main");
SendMessage(m_hwnd, WM_SETICON, ICON_BIG, (LPARAM)IcoLib_GetIcon(iconName, false));
SendMessage(m_hwnd, WM_SETICON, ICON_SMALL, (LPARAM)IcoLib_GetIcon(iconName, true));
@@ -95,7 +95,7 @@ CSteamCaptchaDialog::~CSteamCaptchaDialog() void CSteamCaptchaDialog::OnInitDialog()
{
char iconName[100];
- mir_snprintf(iconName, _countof(iconName), "%s_%s", MODULE, "main");
+ mir_snprintf(iconName, "%s_%s", MODULE, "main");
SendMessage(m_hwnd, WM_SETICON, ICON_BIG, (LPARAM)IcoLib_GetIcon(iconName, false));
SendMessage(m_hwnd, WM_SETICON, ICON_SMALL, (LPARAM)IcoLib_GetIcon(iconName, true));
diff --git a/protocols/Steam/src/steam_menus.cpp b/protocols/Steam/src/steam_menus.cpp index be3282378a..0dd594bf72 100644 --- a/protocols/Steam/src/steam_menus.cpp +++ b/protocols/Steam/src/steam_menus.cpp @@ -45,7 +45,7 @@ int CSteamProto::JoinToGameCommand(WPARAM hContact, LPARAM) {
char url[MAX_PATH];
DWORD gameId = getDword(hContact, "GameID", 0);
- mir_snprintf(url, _countof(url), "steam://rungameid/%lu", gameId);
+ mir_snprintf(url, "steam://rungameid/%lu", gameId);
Utils_OpenUrl(url);
return 0;
}
diff --git a/protocols/Steam/src/steam_proto.cpp b/protocols/Steam/src/steam_proto.cpp index 113c5f47b5..5d5fc876f7 100644 --- a/protocols/Steam/src/steam_proto.cpp +++ b/protocols/Steam/src/steam_proto.cpp @@ -18,10 +18,10 @@ CSteamProto::CSteamProto(const char* protoName, const TCHAR* userName) : GetModuleFileName(g_hInstance, filePath, MAX_PATH); wchar_t sectionName[100]; - mir_sntprintf(sectionName, _countof(sectionName), _T("%s/%s"), LPGENT("Protocols"), LPGENT(MODULE)); + mir_sntprintf(sectionName, _T("%s/%s"), LPGENT("Protocols"), LPGENT(MODULE)); char settingName[100]; - mir_snprintf(settingName, _countof(settingName), "%s_%s", MODULE, "main"); + mir_snprintf(settingName, "%s_%s", MODULE, "main"); SKINICONDESC sid = { 0 }; sid.flags = SIDF_ALL_TCHAR; @@ -32,7 +32,7 @@ CSteamProto::CSteamProto(const char* protoName, const TCHAR* userName) : sid.iDefaultIndex = -IDI_STEAM; IcoLib_AddIcon(&sid); - mir_snprintf(settingName, _countof(settingName), "%s_%s", MODULE, "gaming"); + mir_snprintf(settingName, "%s_%s", MODULE, "gaming"); sid.description.t = LPGENT("Gaming icon"); sid.iDefaultIndex = -IDI_GAMING; IcoLib_AddIcon(&sid); @@ -63,7 +63,7 @@ CSteamProto::CSteamProto(const char* protoName, const TCHAR* userName) : // netlib support TCHAR name[128]; - mir_sntprintf(name, _countof(name), TranslateT("%s connection"), m_tszUserName); + mir_sntprintf(name, TranslateT("%s connection"), m_tszUserName); NETLIBUSER nlu = { sizeof(nlu) }; nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR; diff --git a/protocols/Steam/src/steam_xstatus.cpp b/protocols/Steam/src/steam_xstatus.cpp index 72a4a0e5b6..7a42c3f4e3 100644 --- a/protocols/Steam/src/steam_xstatus.cpp +++ b/protocols/Steam/src/steam_xstatus.cpp @@ -20,7 +20,7 @@ int CSteamProto::GetContactXStatus(MCONTACT hContact) void SetContactExtraIcon(MCONTACT hContact, int status) { char iconName[100]; - mir_snprintf(iconName, _countof(iconName), "%s_%s", MODULE, "gaming"); + mir_snprintf(iconName, "%s_%s", MODULE, "gaming"); ExtraIcon_SetIcon(hExtraXStatus, hContact, (status > 0) ? IcoLib_GetIconHandle(iconName) : NULL); } @@ -96,7 +96,7 @@ HICON CSteamProto::GetXStatusIcon(int status, UINT flags) return 0; char iconName[100]; - mir_snprintf(iconName, _countof(iconName), "%s_%s", MODULE, "gaming"); + mir_snprintf(iconName, "%s_%s", MODULE, "gaming"); HICON icon = IcoLib_GetIcon(iconName, (flags & LR_BIGICON) != 0); return (flags & LR_SHARED) ? icon : CopyIcon(icon); diff --git a/protocols/Tlen/src/tlen.cpp b/protocols/Tlen/src/tlen.cpp index 97f6d9f981..dd1959e8ee 100644 --- a/protocols/Tlen/src/tlen.cpp +++ b/protocols/Tlen/src/tlen.cpp @@ -66,7 +66,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD) return &pluginInfo;
}
-extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_PROTOCOL, MIID_LAST};
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_PROTOCOL, MIID_LAST };
static IconItem iconList[] =
{
@@ -98,7 +98,8 @@ HICON GetIcolibIcon(int iconId) return NULL;
}
-void ReleaseIcolibIcon(HICON hIcon) {
+void ReleaseIcolibIcon(HICON hIcon)
+{
IcoLib_ReleaseIcon(hIcon);
}
@@ -165,7 +166,7 @@ INT_PTR TlenProtocol::ContactMenuHandleSendPicture(WPARAM hContact, LPARAM) INT_PTR TlenProtocol::MenuHandleInbox(WPARAM, LPARAM)
{
- char szFileName[ MAX_PATH ];
+ char szFileName[MAX_PATH];
DBVARIANT dbv;
NETLIBHTTPREQUEST req;
NETLIBHTTPHEADER headers[2];
@@ -185,7 +186,7 @@ INT_PTR TlenProtocol::MenuHandleInbox(WPARAM, LPARAM) memset(&cookie, 0, sizeof(cookie));
if (login != NULL && password != NULL) {
- mir_snprintf( form, _countof(form), "username=%s&password=%s", login, password);
+ mir_snprintf(form, "username=%s&password=%s", login, password);
headers[0].szName = "Content-Type";
headers[0].szValue = "application/x-www-form-urlencoded";
memset(&req, 0, sizeof(req));
@@ -199,9 +200,9 @@ INT_PTR TlenProtocol::MenuHandleInbox(WPARAM, LPARAM) req.szUrl = "http://poczta.o2.pl/login.html";
resp = (NETLIBHTTPREQUEST *)CallService(MS_NETLIB_HTTPTRANSACTION, (WPARAM)m_hNetlibUser, (LPARAM)&req);
if (resp != NULL) {
- if (resp->resultCode/100 == 2 || resp->resultCode == 302) {
+ if (resp->resultCode / 100 == 2 || resp->resultCode == 302) {
int i;
- for (i=0; i<resp->headersCount; i++ ) {
+ for (i = 0; i < resp->headersCount; i++) {
if (strcmpi(resp->headers[i].szName, "Set-Cookie") == 0) {
char *start = strstr(resp->headers[i].szValue, "ssid=");
if (start != NULL) {
@@ -221,8 +222,8 @@ INT_PTR TlenProtocol::MenuHandleInbox(WPARAM, LPARAM) }
mir_free(login);
mir_free(password);
-
- mir_snprintf(szFileName, _countof(szFileName), "http://poczta.o2.pl/login.html?sid=%s", cookie);
+
+ mir_snprintf(szFileName, "http://poczta.o2.pl/login.html?sid=%s", cookie);
Utils_OpenUrl(szFileName);
return 0;
}
@@ -329,7 +330,7 @@ void TlenProtocol::initMenuItems() TlenProtocol* tlenProtoInit(const char* pszProtoName, const TCHAR* tszUserName)
{
- TlenProtocol* ppro = new TlenProtocol( pszProtoName, tszUserName );
+ TlenProtocol* ppro = new TlenProtocol(pszProtoName, tszUserName);
return ppro;
}
@@ -341,12 +342,12 @@ static int tlenProtoUninit(TlenProtocol* ppro) extern "C" int __declspec(dllexport) Load(void)
{
- mir_getLP( &pluginInfo );
+ mir_getLP(&pluginInfo);
mir_getCLI();
DuplicateHandle(GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &hMainThread, THREAD_SET_CONTEXT, FALSE, 0);
- srand((unsigned) time(NULL));
+ srand((unsigned)time(NULL));
TlenRegisterIcons();
@@ -354,8 +355,8 @@ extern "C" int __declspec(dllexport) Load(void) PROTOCOLDESCRIPTOR pd = { 0 };
pd.cbSize = sizeof(pd);
pd.szName = "TLEN";
- pd.fnInit = ( pfnInitProto )tlenProtoInit;
- pd.fnUninit = ( pfnUninitProto )tlenProtoUninit;
+ pd.fnInit = (pfnInitProto)tlenProtoInit;
+ pd.fnUninit = (pfnUninitProto)tlenProtoUninit;
pd.type = PROTOTYPE_PROTOCOL;
Proto_RegisterModule(&pd);
return 0;
diff --git a/protocols/Tlen/src/tlen_avatar.cpp b/protocols/Tlen/src/tlen_avatar.cpp index 44d6134e7c..baa05c1f2f 100644 --- a/protocols/Tlen/src/tlen_avatar.cpp +++ b/protocols/Tlen/src/tlen_avatar.cpp @@ -42,7 +42,7 @@ void TlenGetAvatarFileName(TlenProtocol *proto, TLEN_LIST_ITEM *item, TCHAR* pts else { proto->debugLog(_T("getAvatarFilename(): Can not create directory for avatar cache: %s. errno=%d: %s"), ptszDest, errno, strerror(errno)); TCHAR buffer[512]; - mir_sntprintf(buffer, _countof(buffer), TranslateT("Cannot create avatars cache directory. ERROR: %d: %s\n%s"), errno, _tcserror(errno), ptszDest); + mir_sntprintf(buffer, TranslateT("Cannot create avatars cache directory. ERROR: %d: %s\n%s"), errno, _tcserror(errno), ptszDest); PUShowMessageT(buffer, SM_WARNING); } } @@ -111,7 +111,7 @@ static void SetAvatar(TlenProtocol *proto, MCONTACT hContact, TLEN_LIST_ITEM *it db_set_dw(hContact, proto->m_szModuleName, "AvatarFormat", format); } else { TCHAR buffer[128]; - mir_sntprintf(buffer, _countof(buffer), TranslateT("Cannot save new avatar file \"%s\" Error:\n\t%s (Error: %d)"), filename, _tcserror(errno), errno); + mir_sntprintf(buffer, TranslateT("Cannot save new avatar file \"%s\" Error:\n\t%s (Error: %d)"), filename, _tcserror(errno), errno); PUShowMessageT(buffer, SM_WARNING); proto->debugLog(buffer); return; diff --git a/protocols/Tlen/src/tlen_file.cpp b/protocols/Tlen/src/tlen_file.cpp index 887ef89994..f97f47efae 100644 --- a/protocols/Tlen/src/tlen_file.cpp +++ b/protocols/Tlen/src/tlen_file.cpp @@ -551,7 +551,7 @@ void TlenProcessF(XmlNode *node, ThreadData *info) char *from = TlenXmlGetAttrValue(node, "f");
if (from != NULL) {
if (strchr(from, '@') == NULL)
- mir_snprintf(jid, _countof(jid), "%s@%s", from, info->server);
+ mir_snprintf(jid, "%s@%s", from, info->server);
else
strncpy_s(jid, from, _TRUNCATE);
@@ -577,7 +577,7 @@ void TlenProcessF(XmlNode *node, ThreadData *info) else mir_strcpy(szFilename, Translate("1 File"));
}
else if (numFiles > 1)
- mir_snprintf(szFilename, _countof(szFilename), Translate("%d Files"), numFiles);
+ mir_snprintf(szFilename, Translate("%d Files"), numFiles);
}
if (szFilename[0] != '\0' && ft->iqId != NULL) {
diff --git a/protocols/Tlen/src/tlen_iqid.cpp b/protocols/Tlen/src/tlen_iqid.cpp index 2f2d7ba943..786c642758 100644 --- a/protocols/Tlen/src/tlen_iqid.cpp +++ b/protocols/Tlen/src/tlen_iqid.cpp @@ -54,7 +54,7 @@ void TlenIqResultAuth(TlenProtocol *proto, XmlNode *iqNode) char text[128];
TlenSend(proto, "</s>");
- mir_snprintf(text, _countof(text), Translate("Authentication failed for %s@%s."), proto->threadData->username, proto->threadData->server);
+ mir_snprintf(text, Translate("Authentication failed for %s@%s."), proto->threadData->username, proto->threadData->server);
MessageBoxA(NULL, text, Translate("Tlen Authentication"), MB_OK|MB_ICONSTOP|MB_SETFOREGROUND);
ProtoBroadcastAck(proto->m_szModuleName, NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_WRONGPASSWORD);
proto->threadData = NULL; // To disallow auto reconnect
@@ -258,7 +258,7 @@ void TlenIqResultVcard(TlenProtocol *proto, XmlNode *iqNode) if (strchr(jid, '@') != NULL) {
strncpy_s(text, jid, _TRUNCATE);
} else {
- mir_snprintf(text, _countof(text), "%s@%s", jid, dbv.pszVal); // Add @tlen.pl
+ mir_snprintf(text, "%s@%s", jid, dbv.pszVal); // Add @tlen.pl
}
db_free(&dbv);
if ((hContact=TlenHContactFromJID(proto, text)) == NULL) {
@@ -419,7 +419,7 @@ void TlenIqResultSearch(TlenProtocol *proto, XmlNode *iqNode) if (strchr(jid, '@') != NULL) {
strncpy_s(jsr.jid, jid, _TRUNCATE);
} else {
- mir_snprintf(jsr.jid, _countof(jsr.jid), "%s@%s", jid, dbv.pszVal);
+ mir_snprintf(jsr.jid, "%s@%s", jid, dbv.pszVal);
}
jsr.jid[sizeof(jsr.jid)-1] = '\0';
jsr.hdr.id.t = mir_a2t(jid);
@@ -467,7 +467,7 @@ void TlenIqResultSearch(TlenProtocol *proto, XmlNode *iqNode) if (strchr(proto->searchJID, '@') != NULL)
strncpy_s(jsr.jid, proto->searchJID, _TRUNCATE);
else
- mir_snprintf(jsr.jid, _countof(jsr.jid), "%s@%s", proto->searchJID, dbv.pszVal);
+ mir_snprintf(jsr.jid, "%s@%s", proto->searchJID, dbv.pszVal);
jsr.hdr.nick.t = jsr.hdr.firstName.t = jsr.hdr.lastName.t = jsr.hdr.email.t = jsr.hdr.id.t = TEXT("");
ProtoBroadcastAck(proto->m_szModuleName, NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE) id, (LPARAM) &jsr);
diff --git a/protocols/Tlen/src/tlen_muc.cpp b/protocols/Tlen/src/tlen_muc.cpp index 888d71c5a1..b429c2fee6 100644 --- a/protocols/Tlen/src/tlen_muc.cpp +++ b/protocols/Tlen/src/tlen_muc.cpp @@ -70,7 +70,7 @@ static char *getDisplayName(TlenProtocol *proto, const char *id) MCONTACT hContact;
DBVARIANT dbv;
if (!db_get(NULL, proto->m_szModuleName, "LoginServer", &dbv)) {
- mir_snprintf(jid, _countof(jid), "%s@%s", id, dbv.pszVal);
+ mir_snprintf(jid, "%s@%s", id, dbv.pszVal);
db_free(&dbv);
if (((hContact=TlenHContactFromJID(proto, jid)) != NULL) || !mir_strcmp(id, proto->threadData->username)) {
CONTACTINFO ci = { sizeof(ci) };
@@ -107,7 +107,7 @@ int TlenMUCRecvInvitation(TlenProtocol *proto, const char *roomId, const char*, char jid[256];
DBVARIANT dbv;
if (!db_get(NULL, proto->m_szModuleName, "LoginServer", &dbv)) {
- mir_snprintf(jid, _countof(jid), "%s@%s", from, dbv.pszVal);
+ mir_snprintf(jid, "%s@%s", from, dbv.pszVal);
db_free(&dbv);
} else {
mir_strcpy(jid, from);
@@ -119,7 +119,7 @@ int TlenMUCRecvInvitation(TlenProtocol *proto, const char *roomId, const char*, TLEN_LIST_ITEM *item;
DBVARIANT dbv;
if (!db_get(NULL, proto->m_szModuleName, "LoginServer", &dbv)) {
- mir_snprintf(jid, _countof(jid), "%s@%s", from, dbv.pszVal);
+ mir_snprintf(jid, "%s@%s", from, dbv.pszVal);
db_free(&dbv);
} else {
mir_strcpy(jid, from);
@@ -190,7 +190,7 @@ static int TlenMUCSendQuery(TlenProtocol *proto, int type, const char *parent, i if (type == 3) { // find chat room by name
char serialId[32];
TLEN_LIST_ITEM *item;
- mir_snprintf(serialId, _countof(serialId), TLEN_IQID"%d", TlenSerialNext(proto));
+ mir_snprintf(serialId, TLEN_IQID"%d", TlenSerialNext(proto));
item = TlenListAdd(proto, LIST_SEARCH, serialId);
item->roomName = mir_strdup(parent);
TlenSend(proto, "<iq to='c' type='3' n='%s' id='%s'/>", parent, serialId);
@@ -236,7 +236,7 @@ INT_PTR TlenProtocol::MUCContactMenuHandleMUC(WPARAM wParam, LPARAM) if ((hContact=wParam) != NULL && isOnline) {
if (!db_get(hContact, m_szModuleName, "jid", &dbv)) {
char serialId[32];
- mir_snprintf(serialId, _countof(serialId), TLEN_IQID"%d", TlenSerialNext(this));
+ mir_snprintf(serialId, TLEN_IQID"%d", TlenSerialNext(this));
item = TlenListAdd(this, LIST_INVITATIONS, serialId);
item->nick = mir_strdup(dbv.pszVal);
TlenSend(this, "<p to='c' tp='c' id='%s'/>", serialId);
diff --git a/protocols/Tlen/src/tlen_opt.cpp b/protocols/Tlen/src/tlen_opt.cpp index d904537185..fe413beb9b 100644 --- a/protocols/Tlen/src/tlen_opt.cpp +++ b/protocols/Tlen/src/tlen_opt.cpp @@ -656,7 +656,7 @@ static INT_PTR CALLBACK TlenPopupsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, } else { delay=GetDlgItemInt(hwndDlg, IDC_DELAY, NULL, FALSE); } - mir_sntprintf(title, _countof(title), TranslateT("%S mail"), proto->m_szModuleName); + mir_sntprintf(title, TranslateT("%S mail"), proto->m_szModuleName); MailPopupPreview((DWORD) SendDlgItemMessage(hwndDlg,IDC_COLORBKG,CPM_GETCOLOUR,0,0), (DWORD) SendDlgItemMessage(hwndDlg,IDC_COLORTXT,CPM_GETCOLOUR,0,0), title, diff --git a/protocols/Tlen/src/tlen_p2p_new.cpp b/protocols/Tlen/src/tlen_p2p_new.cpp index 7c7c7ecd50..a2155c16e5 100644 --- a/protocols/Tlen/src/tlen_p2p_new.cpp +++ b/protocols/Tlen/src/tlen_p2p_new.cpp @@ -185,7 +185,7 @@ void TlenBindUDPSocket(TLEN_FILE_TRANSFER *ft) char host_name[256];
gethostname(host_name, sizeof(host_name));
hp = gethostbyname(host_name);
- mir_snprintf(host_name, _countof(host_name), "%u.%u.%u.%u", (unsigned char)hp->h_addr_list[0][0],
+ mir_snprintf(host_name, "%u.%u.%u.%u", (unsigned char)hp->h_addr_list[0][0],
(unsigned char)hp->h_addr_list[0][1],
(unsigned char)hp->h_addr_list[0][2],
(unsigned char)hp->h_addr_list[0][3]);
@@ -259,7 +259,7 @@ void __cdecl TlenProcessP2P(XmlNode *node, ThreadData *info) { if ((item=TlenListAdd(ft->proto, LIST_FILE, ft->iqId)) != NULL) {
char fileInfo[128];
item->ft = ft;
- mir_snprintf(fileInfo, _countof(fileInfo), "%s file(s), %s bytes", c, s);
+ mir_snprintf(fileInfo, "%s file(s), %s bytes", c, s);
TCHAR* filenameT = mir_utf8decodeT((char*)fileInfo);
PROTORECVFILET pre = { 0 };
pre.dwFlags = PRFF_TCHAR;
diff --git a/protocols/Tlen/src/tlen_picture.cpp b/protocols/Tlen/src/tlen_picture.cpp index 1b08824840..840bc0134c 100644 --- a/protocols/Tlen/src/tlen_picture.cpp +++ b/protocols/Tlen/src/tlen_picture.cpp @@ -34,7 +34,7 @@ static void LogPictureMessage(TlenProtocol *proto, const char *jid, const char * {
char message[1024];
const char *msg = isSent ? LPGEN("Image sent file://%s") : LPGEN("Image received file://%s");
- mir_snprintf(message, _countof(message), Translate(msg), filename);
+ mir_snprintf(message, Translate(msg), filename);
TlenLogMessage(proto, TlenHContactFromJID(proto, jid), isSent ? DBEF_SENT : 0, message);
}
@@ -49,7 +49,7 @@ static void TlenPsPostThread(void *ptr) { DWORD ret;
item->ft->s = socket;
item->ft->hFileEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
- ret = mir_snprintf(header, _countof(header), "<pic auth='%s' t='p' to='%s' size='%d' idt='%s'/>", proto->threadData->username, item->ft->jid, item->ft->fileTotalSize, item->jid);
+ ret = mir_snprintf(header, "<pic auth='%s' t='p' to='%s' size='%d' idt='%s'/>", proto->threadData->username, item->ft->jid, item->ft->fileTotalSize, item->jid);
TlenWsSend(proto, socket, header, (int)ret);
ret = WaitForSingleObject(item->ft->hFileEvent, 1000 * 60 * 5);
if (ret == WAIT_OBJECT_0) {
@@ -58,7 +58,7 @@ static void TlenPsPostThread(void *ptr) { int i;
char header[512];
char fileBuffer[2048];
- i = mir_snprintf(header, _countof(header), "<pic st='%s' idt='%s'/>", item->ft->iqId, item->jid);
+ i = mir_snprintf(header, "<pic st='%s' idt='%s'/>", item->ft->iqId, item->jid);
TlenWsSend(proto, socket, header, i);
proto->debugLogA("Sending picture data...");
for (i = item->ft->filesSize[0]; i > 0; ) {
@@ -114,7 +114,7 @@ static void TlenPsGetThread(void *ptr) { char header[512];
char fileBuffer[2048];
TlenXmlInitState(&xmlState);
- int header_len = mir_snprintf(header, _countof(header), "<pic auth='%s' t='g' to='%s' pid='1001' idt='%s' rt='%s'/>", proto->threadData->username, item->ft->jid, item->jid, item->ft->id2);
+ int header_len = mir_snprintf(header, "<pic auth='%s' t='g' to='%s' pid='1001' idt='%s' rt='%s'/>", proto->threadData->username, item->ft->jid, item->jid, item->ft->id2);
TlenWsSend(proto, socket, header, header_len);
proto->debugLogA("Reveiving picture data...");
{
@@ -221,7 +221,7 @@ void TlenProcessPic(XmlNode *node, TlenProtocol *proto) { char fileName[MAX_PATH];
char *ext = TlenXmlGetAttrValue(node, "ext");
char *tmpPath = Utils_ReplaceVars( "%miranda_userdata%" );
- int tPathLen = mir_snprintf(fileName, _countof(fileName), "%s\\Images\\Tlen", tmpPath);
+ int tPathLen = mir_snprintf(fileName, "%s\\Images\\Tlen", tmpPath);
long oldSize = 0, lSize = atol(size);
DWORD dwAttributes = GetFileAttributesA( fileName );
if ( dwAttributes == 0xffffffff || ( dwAttributes & FILE_ATTRIBUTE_DIRECTORY ) == 0 )
@@ -285,7 +285,7 @@ BOOL SendPicture(TlenProtocol *proto, MCONTACT hContact) { char fileBuffer[2048];
int id = TlenSerialNext(proto);
T2Utf szFileName(tszFileName);
- mir_snprintf(idStr, _countof(idStr), "%d", id);
+ mir_snprintf(idStr, "%d", id);
item = TlenListAdd(proto, LIST_PICTURE, idStr);
item->ft = TlenFileCreateFT(proto, jid);
item->ft->files = (char **) mir_alloc(sizeof(char *));
diff --git a/protocols/Tlen/src/tlen_svc.cpp b/protocols/Tlen/src/tlen_svc.cpp index 5108cba8cc..c8aaed11fe 100644 --- a/protocols/Tlen/src/tlen_svc.cpp +++ b/protocols/Tlen/src/tlen_svc.cpp @@ -803,7 +803,7 @@ HANDLE TlenProtocol::SendFile(MCONTACT hContact, const TCHAR* szDescription, TCH db_free(&dbv);
int id = TlenSerialNext(this);
- mir_snprintf(idStr, _countof(idStr), "%d", id);
+ mir_snprintf(idStr, "%d", id);
TLEN_LIST_ITEM *item = TlenListAdd(this, LIST_FILE, idStr);
if (item != NULL) {
ft->iqId = mir_strdup(idStr);
diff --git a/protocols/Tlen/src/tlen_thread.cpp b/protocols/Tlen/src/tlen_thread.cpp index 3a736cc836..3567701282 100644 --- a/protocols/Tlen/src/tlen_thread.cpp +++ b/protocols/Tlen/src/tlen_thread.cpp @@ -72,7 +72,7 @@ static INT_PTR CALLBACK TlenPasswordDlgProc(HWND hwndDlg, UINT msg, WPARAM wPara switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- mir_snprintf(text, _countof(text), Translate("Enter password for %s"), (char *) lParam);
+ mir_snprintf(text, Translate("Enter password for %s"), (char *) lParam);
SetDlgItemTextA(hwndDlg, IDC_JID, text);
return TRUE;
case WM_COMMAND:
@@ -207,7 +207,7 @@ void __cdecl TlenServerThread(ThreadData *info) return;
}
- mir_snprintf(jidStr, _countof(jidStr), "%s@%s", info->username, info->server);
+ mir_snprintf(jidStr, "%s@%s", info->username, info->server);
db_set_s(NULL, info->proto->m_szModuleName, "jid", jidStr);
if (!db_get(NULL, info->proto->m_szModuleName, "ManualHost", &dbv)) {
@@ -400,7 +400,7 @@ static void TlenSendAuth(TlenProtocol *proto) { int iqId;
char text[128];
char *str = TlenPasswordHash(proto->threadData->password);
- mir_snprintf(text, _countof(text), "%s%s", proto->threadData->streamId, str);
+ mir_snprintf(text, "%s%s", proto->threadData->streamId, str);
mir_free(str);
str = TlenSha1(text);
char *p=TlenTextEncode(proto->threadData->username);
@@ -913,7 +913,7 @@ static void TlenProcessW(XmlNode *node, ThreadData *info) char *f = TlenXmlGetAttrValue(node, "f");
if (f != NULL) {
char webContactName[128];
- mir_snprintf(webContactName, _countof(webContactName), Translate("%s Web Messages"), info->proto->m_szModuleName);
+ mir_snprintf(webContactName, Translate("%s Web Messages"), info->proto->m_szModuleName);
MCONTACT hContact = TlenHContactFromJID(info->proto, webContactName);
if (hContact == NULL) {
hContact = TlenDBCreateContact(info->proto, webContactName, webContactName, TRUE);
@@ -1204,7 +1204,7 @@ static void TlenProcessV(XmlNode *node, ThreadData *info) char *from=TlenXmlGetAttrValue(node, "f");
if (from != NULL) {
if (strchr(from, '@') == NULL) {
- mir_snprintf(jid, _countof(jid), "%s@%s", from, info->server);
+ mir_snprintf(jid, "%s@%s", from, info->server);
} else {
strncpy_s(jid, from, _TRUNCATE);
}
diff --git a/protocols/Tlen/src/tlen_voice.cpp b/protocols/Tlen/src/tlen_voice.cpp index 8b31557e48..00d0afacb8 100644 --- a/protocols/Tlen/src/tlen_voice.cpp +++ b/protocols/Tlen/src/tlen_voice.cpp @@ -493,7 +493,7 @@ static void TlenVoiceReceiveParse(TLEN_FILE_TRANSFER *ft) }
{
char ttt[2048];
- mir_snprintf(ttt, _countof(ttt), "%s %d %d ", statusTxt, ft->proto->framesAvailableForPlayback, ft->proto->availOverrunValue);
+ mir_snprintf(ttt, "%s %d %d ", statusTxt, ft->proto->framesAvailableForPlayback, ft->proto->availOverrunValue);
SetDlgItemTextA(ft->proto->voiceDlgHWND, IDC_STATUS, ttt);
}
TlenP2PPacketFree(packet);
@@ -683,7 +683,7 @@ INT_PTR TlenProtocol::VoiceContactMenuHandleVoice(WPARAM wParam, LPARAM) DBVARIANT dbv;
if (!db_get(hContact, m_szModuleName, "jid", &dbv)) {
char serialId[32];
- mir_snprintf(serialId, _countof(serialId), "%d", TlenSerialNext(this));
+ mir_snprintf(serialId, "%d", TlenSerialNext(this));
TLEN_LIST_ITEM *item = TlenListAdd(this, LIST_VOICE, serialId);
if (item != NULL) {
TLEN_FILE_TRANSFER *ft = TlenFileCreateFT(this, dbv.pszVal);
@@ -931,7 +931,7 @@ static char *getDisplayName(TlenProtocol *proto, const char *id) MCONTACT hContact;
DBVARIANT dbv;
if (!db_get(NULL, proto->m_szModuleName, "LoginServer", &dbv)) {
- mir_snprintf(jid, _countof(jid), "%s@%s", id, dbv.pszVal);
+ mir_snprintf(jid, "%s@%s", id, dbv.pszVal);
db_free(&dbv);
if ((hContact = TlenHContactFromJID(proto, jid)) != NULL)
return mir_strdup((char *)pcli->pfnGetContactDisplayName(hContact, 0));
@@ -1012,7 +1012,7 @@ int TlenVoiceAccept(TlenProtocol *proto, const char *id, const char *from) char jid[256];
DBVARIANT dbv;
if (!db_get(NULL, proto->m_szModuleName, "LoginServer", &dbv)) {
- mir_snprintf(jid, _countof(jid), "%s@%s", from, dbv.pszVal);
+ mir_snprintf(jid, "%s@%s", from, dbv.pszVal);
db_free(&dbv);
}
else {
@@ -1025,7 +1025,7 @@ int TlenVoiceAccept(TlenProtocol *proto, const char *id, const char *from) char jid[256];
DBVARIANT dbv;
if (!db_get(NULL, proto->m_szModuleName, "LoginServer", &dbv)) {
- mir_snprintf(jid, _countof(jid), "%s@%s", from, dbv.pszVal);
+ mir_snprintf(jid, "%s@%s", from, dbv.pszVal);
db_free(&dbv);
}
else {
diff --git a/protocols/Tlen/src/tlen_ws.cpp b/protocols/Tlen/src/tlen_ws.cpp index 8b0a40554f..10d7042ae9 100644 --- a/protocols/Tlen/src/tlen_ws.cpp +++ b/protocols/Tlen/src/tlen_ws.cpp @@ -32,13 +32,13 @@ BOOL TlenWsInit(TlenProtocol *proto) nlu.cbSize = sizeof(nlu);
nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_HTTPCONNS | NUF_TCHAR; // | NUF_HTTPGATEWAY;
- mir_sntprintf(name, _countof(name), TranslateT("%s connection"), proto->m_tszUserName);
+ mir_sntprintf(name, TranslateT("%s connection"), proto->m_tszUserName);
nlu.ptszDescriptiveName = name;
nlu.szSettingsModule = proto->m_szModuleName;
proto->m_hNetlibUser = (HANDLE) CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM) &nlu);
nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_NOOPTIONS | NUF_TCHAR;
- mir_sntprintf(name, _countof(name), TranslateT("%s SOCKS connection"), proto->m_tszUserName);
+ mir_sntprintf(name, TranslateT("%s SOCKS connection"), proto->m_tszUserName);
nlu.ptszDescriptiveName = name;
proto->hFileNetlibUser = (HANDLE) CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM) &nlu);
nlus.cbSize = sizeof(nlus);
diff --git a/protocols/Tox/src/tox_avatars.cpp b/protocols/Tox/src/tox_avatars.cpp index a819f1bd3f..e8aab00e57 100644 --- a/protocols/Tox/src/tox_avatars.cpp +++ b/protocols/Tox/src/tox_avatars.cpp @@ -3,7 +3,7 @@ std::tstring CToxProto::GetAvatarFilePath(MCONTACT hContact)
{
TCHAR path[MAX_PATH];
- mir_sntprintf(path, _countof(path), _T("%s\\%S"), VARST(_T("%miranda_avatarcache%")), m_szModuleName);
+ mir_sntprintf(path, _T("%s\\%S"), VARST(_T("%miranda_avatarcache%")), m_szModuleName);
DWORD dwAttributes = GetFileAttributes(path);
if (dwAttributes == 0xffffffff || (dwAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0)
@@ -229,7 +229,7 @@ void CToxProto::OnGotFriendAvatarInfo(AvatarTransferParam *transfer) }
TCHAR path[MAX_PATH];
- mir_sntprintf(path, _countof(path), _T("%s\\%S"), VARST(_T("%miranda_avatarcache%")), m_szModuleName);
+ mir_sntprintf(path, _T("%s\\%S"), VARST(_T("%miranda_avatarcache%")), m_szModuleName);
OnFileAllow(transfer->pfts.hContact, transfer, path);
}
diff --git a/protocols/Tox/src/tox_chatrooms.cpp b/protocols/Tox/src/tox_chatrooms.cpp index a0363afd5f..ae7ef71ada 100644 --- a/protocols/Tox/src/tox_chatrooms.cpp +++ b/protocols/Tox/src/tox_chatrooms.cpp @@ -29,7 +29,7 @@ MCONTACT CToxProto::AddChatRoom(int groupNumber) setWord(hContact, TOX_SETTINGS_CHAT_ID, groupNumber);
TCHAR title[MAX_PATH];
- mir_sntprintf(title, _countof(title), _T("%s #%d"), TranslateT("Groupchat"), groupNumber);
+ mir_sntprintf(title, _T("%s #%d"), TranslateT("Groupchat"), groupNumber);
setTString(hContact, "Nick", title);
DBVARIANT dbv;
diff --git a/protocols/Tox/src/tox_icons.cpp b/protocols/Tox/src/tox_icons.cpp index 3bb4302513..756fc13bad 100644 --- a/protocols/Tox/src/tox_icons.cpp +++ b/protocols/Tox/src/tox_icons.cpp @@ -23,10 +23,10 @@ void CToxProto::InitIcons() sid.pszName = szSettingName;
sid.section.t = szSectionName;
- mir_sntprintf(szSectionName, _countof(szSectionName), _T("%s/%s"), LPGENT("Protocols"), LPGENT(MODULE));
+ mir_sntprintf(szSectionName, _T("%s/%s"), LPGENT("Protocols"), LPGENT(MODULE));
for (int i = 0; i < _countof(Icons); i++)
{
- mir_snprintf(szSettingName, _countof(szSettingName), "%s_%s", MODULE, Icons[i].Name);
+ mir_snprintf(szSettingName, "%s_%s", MODULE, Icons[i].Name);
sid.description.t = Icons[i].Description;
sid.iDefaultIndex = -Icons[i].IconId;
@@ -55,7 +55,7 @@ HANDLE CToxProto::GetIconHandle(const char *name) HANDLE CToxProto::Skin_GetIconHandle(const char *name)
{
char iconName[100];
- mir_snprintf(iconName, _countof(iconName), "%s_%s", MODULE, name);
+ mir_snprintf(iconName, "%s_%s", MODULE, name);
HANDLE hIcon = IcoLib_GetIconHandle(iconName);
if (hIcon == NULL)
hIcon = GetIconHandle(name);
diff --git a/protocols/Tox/src/tox_multimedia.cpp b/protocols/Tox/src/tox_multimedia.cpp index 7fa7a9c7b8..d24a5df474 100644 --- a/protocols/Tox/src/tox_multimedia.cpp +++ b/protocols/Tox/src/tox_multimedia.cpp @@ -27,7 +27,7 @@ INT_PTR CToxCallDlgBase::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) void CToxCallDlgBase::SetIcon(const char *name)
{
char iconName[100];
- mir_snprintf(iconName, _countof(iconName), "%s_%s", MODULE, name);
+ mir_snprintf(iconName, "%s_%s", MODULE, name);
SendMessage(m_hwnd, WM_SETICON, ICON_BIG, (LPARAM)IcoLib_GetIcon(iconName, false));
SendMessage(m_hwnd, WM_SETICON, ICON_SMALL, (LPARAM)IcoLib_GetIcon(iconName, true));
}
@@ -56,7 +56,7 @@ void CToxIncomingCall::OnInitDialog() from.SetText(nick);
TCHAR title[MAX_PATH];
- mir_sntprintf(title, _countof(title), TranslateT("Incoming call from %s"), nick);
+ mir_sntprintf(title, TranslateT("Incoming call from %s"), nick);
SetTitle(title);
SetIcon("audio_ring");
}
@@ -98,7 +98,7 @@ void CToxOutgoingCall::OnInitDialog() to.SetText(nick);
TCHAR title[MAX_PATH];
- mir_sntprintf(title, _countof(title), TranslateT("Outgoing call to %s"), nick);
+ mir_sntprintf(title, TranslateT("Outgoing call to %s"), nick);
SetTitle(title);
SetIcon("audio_end");
}
@@ -290,7 +290,7 @@ void CToxProto::OnAvInvite(void*, int32_t callId, void *arg) }
TCHAR message[MAX_PATH];
- mir_sntprintf(message, _countof(message), TranslateT("Incoming call from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
+ mir_sntprintf(message, TranslateT("Incoming call from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
T2Utf szMessage(message);
PROTORECVEVENT recv = { 0 };
@@ -317,7 +317,7 @@ INT_PTR CToxProto::OnRecvAudioCall(WPARAM hContact, LPARAM lParam) cle.hIcon = IcoLib_GetIconByHandle(GetIconHandle("audio_ring"));
TCHAR szTooltip[MAX_PATH];
- mir_sntprintf(szTooltip, _countof(szTooltip), TranslateT("Incoming call from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
+ mir_sntprintf(szTooltip, TranslateT("Incoming call from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
cle.ptszTooltip = szTooltip;
char szService[MAX_PATH];
diff --git a/protocols/Tox/src/tox_netlib.cpp b/protocols/Tox/src/tox_netlib.cpp index b08bc7ddf9..4c1ae3e09f 100644 --- a/protocols/Tox/src/tox_netlib.cpp +++ b/protocols/Tox/src/tox_netlib.cpp @@ -3,7 +3,7 @@ void CToxProto::InitNetlib()
{
wchar_t name[128];
- mir_sntprintf(name, _countof(name), TranslateT("%s connection"), m_tszUserName);
+ mir_sntprintf(name, TranslateT("%s connection"), m_tszUserName);
NETLIBUSER nlu = {0};
nlu.cbSize = sizeof(nlu);
diff --git a/protocols/Tox/src/tox_network.cpp b/protocols/Tox/src/tox_network.cpp index e8fa7ef88d..84db80e7c3 100644 --- a/protocols/Tox/src/tox_network.cpp +++ b/protocols/Tox/src/tox_network.cpp @@ -20,7 +20,7 @@ void CToxProto::BootstrapNode(const char *address, int port, const char *hexKey) void CToxProto::BootstrapNodesFromDb(bool isIPv6)
{
char module[MAX_PATH];
- mir_snprintf(module, _countof(module), "%s_Nodes", m_szModuleName);
+ mir_snprintf(module, "%s_Nodes", m_szModuleName);
int nodeCount = db_get_w(NULL, module, TOX_SETTINGS_NODE_COUNT, 0);
if (nodeCount > 0)
{
diff --git a/protocols/Tox/src/tox_options.cpp b/protocols/Tox/src/tox_options.cpp index 7376bd02e0..0e9ccafc6b 100644 --- a/protocols/Tox/src/tox_options.cpp +++ b/protocols/Tox/src/tox_options.cpp @@ -109,7 +109,7 @@ void CToxOptionsMain::ProfileCreate_OnClick(CCtrlButton*) void CToxOptionsMain::ProfileImport_OnClick(CCtrlButton*)
{
TCHAR filter[MAX_PATH];
- mir_sntprintf(filter, _countof(filter), _T("%s(*.tox)%c*.tox%c%s(*.*)%c*.*%c%c"),
+ mir_sntprintf(filter, _T("%s(*.tox)%c*.tox%c%s(*.*)%c*.*%c%c"),
TranslateT("Tox profile"), 0, 0, TranslateT("All files"), 0, 0, 0);
TCHAR profilePath[MAX_PATH] = { 0 };
@@ -141,7 +141,7 @@ void CToxOptionsMain::ProfileImport_OnClick(CCtrlButton*) void CToxOptionsMain::ProfileExport_OnClick(CCtrlButton*)
{
TCHAR filter[MAX_PATH];
- mir_sntprintf(filter, _countof(filter), _T("%s(*.tox)%c*.tox%c%c"),
+ mir_sntprintf(filter, _T("%s(*.tox)%c*.tox%c%c"),
TranslateT("Tox profile"), 0, 0, 0);
TCHAR profilePath[MAX_PATH];
@@ -195,7 +195,7 @@ CToxOptionsMultimedia::CToxOptionsMultimedia(CToxProto *proto) bool CToxOptionsMultimedia::GetDeviceFullName(GUID guid, TCHAR *deviceName, DWORD deviceNameLength)
{
TCHAR registryKey[MAX_PATH];
- mir_sntprintf(registryKey, _countof(registryKey), _T("System\\CurrentControlSet\\Control\\MediaCategories\\{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}"),
+ mir_sntprintf(registryKey, _T("System\\CurrentControlSet\\Control\\MediaCategories\\{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}"),
guid.Data1, guid.Data2, guid.Data3, guid.Data4[0], guid.Data4[1], guid.Data4[2], guid.Data4[3], guid.Data4[4], guid.Data4[5], guid.Data4[6], guid.Data4[7]);
HKEY hKey;
@@ -424,7 +424,7 @@ void CToxOptionsNodeList::OnInitDialog() }
char module[MAX_PATH], setting[MAX_PATH];
- mir_snprintf(module, _countof(module), "%s_Nodes", m_proto->m_szModuleName);
+ mir_snprintf(module, "%s_Nodes", m_proto->m_szModuleName);
int nodeCount = db_get_w(NULL, module, TOX_SETTINGS_NODE_COUNT, 0);
for (int i = 0; i < nodeCount; i++)
{
@@ -530,7 +530,7 @@ void CToxOptionsNodeList::OnApply() lvi.pszText = (TCHAR*)mir_alloc(MAX_PATH * sizeof(TCHAR));
char module[MAX_PATH];
- mir_snprintf(module, _countof(module), "%s_Nodes", m_proto->m_szModuleName);
+ mir_snprintf(module, "%s_Nodes", m_proto->m_szModuleName);
int iItem = 0;
int itemCount = m_nodes.GetItemCount();
diff --git a/protocols/Tox/src/tox_search.cpp b/protocols/Tox/src/tox_search.cpp index eee0c009d4..33479ba034 100644 --- a/protocols/Tox/src/tox_search.cpp +++ b/protocols/Tox/src/tox_search.cpp @@ -95,7 +95,7 @@ void CToxProto::SearchByNameAsync(void *arg) {
dnsString[length] = 0;
char dnsQuery[MAX_PATH * 2];
- mir_snprintf(dnsQuery, _countof(dnsQuery), "_%s._tox.%s", dnsString, dnsDomain);
+ mir_snprintf(dnsQuery, "_%s._tox.%s", dnsString, dnsDomain);
ToxHexAddress address = ResolveToxAddressFromDns(dnsQuery);
if (!address.IsEmpty())
@@ -106,7 +106,7 @@ void CToxProto::SearchByNameAsync(void *arg) psr.nick.a = mir_strdup(name);
char email[MAX_PATH];
- mir_snprintf(email, _countof(email), "%s@%s", name, domain);
+ mir_snprintf(email, "%s@%s", name, domain);
psr.email.a = mir_strdup(email);
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)1, (LPARAM)&psr);
@@ -123,7 +123,7 @@ void CToxProto::SearchByNameAsync(void *arg) if (resolved == 0 && domain)
{
char dnsQuery[MAX_PATH];
- mir_snprintf(dnsQuery, _countof(dnsQuery), "%s._tox.%s", name, domain);
+ mir_snprintf(dnsQuery, "%s._tox.%s", name, domain);
ToxHexAddress address = ResolveToxAddressFromDns(dnsQuery);
if (!address.IsEmpty())
@@ -134,7 +134,7 @@ void CToxProto::SearchByNameAsync(void *arg) psr.nick.a = mir_strdup(name);
char email[MAX_PATH];
- mir_snprintf(email, _countof(email), "%s@%s", name, domain);
+ mir_snprintf(email, "%s@%s", name, domain);
psr.email.a = mir_strdup(email);
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)1, (LPARAM)&psr);
diff --git a/protocols/Tox/src/tox_transfer.cpp b/protocols/Tox/src/tox_transfer.cpp index 7b61637cff..da28e1f120 100644 --- a/protocols/Tox/src/tox_transfer.cpp +++ b/protocols/Tox/src/tox_transfer.cpp @@ -76,7 +76,7 @@ HANDLE CToxProto::OnFileAllow(MCONTACT hContact, HANDLE hTransfer, const TCHAR * // stupid fix
TCHAR fullPath[MAX_PATH];
- mir_sntprintf(fullPath, _countof(fullPath), _T("%s\\%s"), transfer->pfts.tszWorkingDir, transfer->pfts.tszCurrentFile);
+ mir_sntprintf(fullPath, _T("%s\\%s"), transfer->pfts.tszWorkingDir, transfer->pfts.tszCurrentFile);
transfer->ChangeName(fullPath);
if (!ProtoBroadcastAck(hContact, ACKTYPE_FILE, ACKRESULT_FILERESUME, (HANDLE)transfer, (LPARAM)&transfer->pfts))
diff --git a/protocols/Twitter/src/proto.cpp b/protocols/Twitter/src/proto.cpp index 3891325d47..88f3be83c5 100644 --- a/protocols/Twitter/src/proto.cpp +++ b/protocols/Twitter/src/proto.cpp @@ -45,7 +45,7 @@ TwitterProto::TwitterProto(const char *proto_name, const TCHAR *username) : // Initialize hotkeys
char text[512];
- mir_snprintf(text, _countof(text), "%s/Tweet", m_szModuleName);
+ mir_snprintf(text, "%s/Tweet", m_szModuleName);
HOTKEYDESC hkd = { sizeof(hkd) };
hkd.pszName = text;
@@ -324,7 +324,7 @@ int TwitterProto::OnModulesLoaded(WPARAM, LPARAM) // Create avatar network connection (TODO: probably remove this)
char module[512];
- mir_snprintf(module, _countof(module), "%sAv", m_szModuleName);
+ mir_snprintf(module, "%sAv", m_szModuleName);
nlu.szSettingsModule = module;
mir_sntprintf(descr, TranslateT("%s avatar connection"), m_tszUserName);
nlu.ptszDescriptiveName = descr;
@@ -380,7 +380,7 @@ int TwitterProto::ShowPinDialog() void TwitterProto::ShowPopup(const wchar_t *text, int Error)
{
POPUPDATAT popup = {};
- mir_sntprintf(popup.lptzContactName, _countof(popup.lptzContactName), TranslateT("%s Protocol"), m_tszUserName);
+ mir_sntprintf(popup.lptzContactName, TranslateT("%s Protocol"), m_tszUserName);
wcsncpy_s(popup.lptzText, text, _TRUNCATE);
if (Error) {
@@ -398,7 +398,7 @@ void TwitterProto::ShowPopup(const wchar_t *text, int Error) void TwitterProto::ShowPopup(const char *text, int Error)
{
POPUPDATAT popup = {};
- mir_sntprintf(popup.lptzContactName, _countof(popup.lptzContactName), TranslateT("%s Protocol"), m_tszUserName);
+ mir_sntprintf(popup.lptzContactName, TranslateT("%s Protocol"), m_tszUserName);
mbcs_to_tcs(CP_UTF8, text, popup.lptzText, _countof(popup.lptzText));
if (Error) {
popup.iSeconds = -1;
@@ -422,7 +422,7 @@ void TwitterProto::SendTweetWorker(void *p) char *text = static_cast<char*>(p);
if (mir_strlen(mir_utf8decodeA(text)) > 140) { // looks like the chat max outgoing msg thing doesn't work, so i'll do it here.
TCHAR errorPopup[280];
- mir_sntprintf(errorPopup, _countof(errorPopup), TranslateT("Don't be crazy! Everyone knows the max tweet size is 140, and you're trying to fit %d chars in there?"), mir_strlen(text));
+ mir_sntprintf(errorPopup, TranslateT("Don't be crazy! Everyone knows the max tweet size is 140, and you're trying to fit %d chars in there?"), mir_strlen(text));
ShowPopup(errorPopup, 1);
return;
}
@@ -455,7 +455,7 @@ void TwitterProto::UpdateSettings() std::tstring TwitterProto::GetAvatarFolder()
{
TCHAR path[MAX_PATH];
- mir_sntprintf(path, _countof(path), _T("%s\\%s"), VARST(_T("%miranda_avatarcache%")), m_tszUserName);
+ mir_sntprintf(path, _T("%s\\%s"), VARST(_T("%miranda_avatarcache%")), m_tszUserName);
return path;
}
diff --git a/protocols/Twitter/src/ui.cpp b/protocols/Twitter/src/ui.cpp index ae8dd27cfc..fd82475a54 100644 --- a/protocols/Twitter/src/ui.cpp +++ b/protocols/Twitter/src/ui.cpp @@ -113,7 +113,7 @@ INT_PTR CALLBACK tweet_proc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPara // Set window title
TCHAR title[512];
- mir_sntprintf(title, _countof(title), _T("Send Tweet for %s"), proto->m_tszUserName);
+ mir_sntprintf(title, _T("Send Tweet for %s"), proto->m_tszUserName);
SetWindowText(hwndDlg, title);
return true;
@@ -146,7 +146,7 @@ INT_PTR CALLBACK tweet_proc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPara case WM_SETREPLY:
char foo[512];
- mir_snprintf(foo, _countof(foo), "@%s ", (char*)wParam);
+ mir_snprintf(foo, "@%s ", (char*)wParam);
size_t len = mir_strlen(foo);
SetDlgItemTextA(hwndDlg, IDC_TWEETMSG, foo);
@@ -190,7 +190,7 @@ INT_PTR CALLBACK options_proc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar else SendDlgItemMessage(hwndDlg, IDC_BASEURL, CB_SETCURSEL, 0, 0);
char pollrate_str[32];
- mir_snprintf(pollrate_str, _countof(pollrate_str), "%d", proto->getDword(TWITTER_KEY_POLLRATE, 80));
+ mir_snprintf(pollrate_str, "%d", proto->getDword(TWITTER_KEY_POLLRATE, 80));
SetDlgItemTextA(hwndDlg, IDC_POLLRATE, pollrate_str);
CheckDlgButton(hwndDlg, IDC_TWEET_MSG, proto->getByte(TWITTER_KEY_TWEET_TO_MSG, 0) ? BST_CHECKED : BST_UNCHECKED);
diff --git a/protocols/VKontakte/src/misc.cpp b/protocols/VKontakte/src/misc.cpp index 67dec9e9cd..e3ae67cb04 100644 --- a/protocols/VKontakte/src/misc.cpp +++ b/protocols/VKontakte/src/misc.cpp @@ -732,7 +732,7 @@ void CVkProto::SetSrmmReadStatus(MCONTACT hContact) StatusTextData st = { 0 };
st.cbSize = sizeof(st);
st.hIcon = IcoLib_GetIconByHandle(GetIconHandle(IDI_READMSG));
- mir_sntprintf(st.tszText, _countof(st.tszText), TranslateT("Message read: %s"), ttime);
+ mir_sntprintf(st.tszText, TranslateT("Message read: %s"), ttime);
CallService(MS_MSG_SETSTATUSTEXT, (WPARAM)hContact, (LPARAM)&st);
}
@@ -747,7 +747,7 @@ char* CVkProto::GetStickerId(const char* Msg, int &stickerid) if (tmpMsg)
iRes = sscanf(tmpMsg, "[sticker:%d]", &stickerid);
if (iRes == 1) {
- mir_snprintf(HeadMsg, _countof(HeadMsg), "[sticker:%d]", stickerid);
+ mir_snprintf(HeadMsg, "[sticker:%d]", stickerid);
size_t retLen = mir_strlen(HeadMsg);
if (retLen < mir_strlen(Msg)) {
CMStringA szMsg(Msg, int(mir_strlen(Msg) - mir_strlen(tmpMsg)));
diff --git a/protocols/VKontakte/src/vk_search.cpp b/protocols/VKontakte/src/vk_search.cpp index cf8616d9d5..dbd6ff57b9 100644 --- a/protocols/VKontakte/src/vk_search.cpp +++ b/protocols/VKontakte/src/vk_search.cpp @@ -71,7 +71,7 @@ void __cdecl CVkProto::SearchThread(void* p) PROTOSEARCHBYNAME *pParam = (PROTOSEARCHBYNAME *)p;
TCHAR arg[200];
- mir_sntprintf(arg, _countof(arg), _T("%s %s %s"), pParam->pszFirstName, pParam->pszNick, pParam->pszLastName);
+ mir_sntprintf(arg, _T("%s %s %s"), pParam->pszFirstName, pParam->pszNick, pParam->pszLastName);
debugLog(_T("CVkProto::SearchThread %s"), arg);
if (!IsOnline())
return;
diff --git a/protocols/WhatsApp/src/avatars.cpp b/protocols/WhatsApp/src/avatars.cpp index 43016048ee..670d5acae7 100644 --- a/protocols/WhatsApp/src/avatars.cpp +++ b/protocols/WhatsApp/src/avatars.cpp @@ -102,8 +102,8 @@ int WhatsAppProto::InternalSetAvatar(MCONTACT hContact, const char *szJid, const TCHAR tszTempFile[MAX_PATH], tszMyFile[MAX_PATH];
if (hContact == NULL) {
- mir_sntprintf(tszMyFile, _countof(tszMyFile), _T("%s\\myavatar.jpg"), m_tszAvatarFolder.c_str());
- mir_sntprintf(tszTempFile, _countof(tszTempFile), _T("%s\\myavatar.preview.jpg"), m_tszAvatarFolder.c_str());
+ mir_sntprintf(tszMyFile, _T("%s\\myavatar.jpg"), m_tszAvatarFolder.c_str());
+ mir_sntprintf(tszTempFile, _T("%s\\myavatar.preview.jpg"), m_tszAvatarFolder.c_str());
}
else {
std::tstring tszContactAva = GetAvatarFileName(hContact);
diff --git a/protocols/Xfire/src/Xfire_base.cpp b/protocols/Xfire/src/Xfire_base.cpp index b5f9d12201..e7dc71b9bc 100644 --- a/protocols/Xfire/src/Xfire_base.cpp +++ b/protocols/Xfire/src/Xfire_base.cpp @@ -466,7 +466,7 @@ BOOL Xfire_base::getIniValue(unsigned int gameid, unsigned int subid, const char return FALSE; //kein pfad bug?!?!
if (subid == 0) {
- mir_snprintf(idstring, _countof(idstring), "%d", gameid);
+ mir_snprintf(idstring, "%d", gameid);
if (xfire_GetPrivateProfileString(idstring, valname, "", out, sizeofout, path))
return TRUE;
@@ -474,7 +474,7 @@ BOOL Xfire_base::getIniValue(unsigned int gameid, unsigned int subid, const char subid++;
}
- mir_snprintf(idstring, _countof(idstring), "%d_%d", gameid, subid);
+ mir_snprintf(idstring, "%d_%d", gameid, subid);
if (xfire_GetPrivateProfileString(idstring, valname, "", out, sizeofout, path))
return TRUE;
@@ -511,7 +511,7 @@ BOOL Xfire_base::getGamename(unsigned int gameid, char* out, int outsize) //customnamen laden, wenn vorhanden
DBVARIANT dbv;
char dbstr[XFIRE_MAXSIZEOFGAMENAME];
- mir_snprintf(dbstr, _countof(dbstr), "customgamename_%d", gameid);
+ mir_snprintf(dbstr, "customgamename_%d", gameid);
if (!db_get(NULL, protocolname, dbstr, &dbv)) {
strncpy_s(out, outsize, dbv.pszVal, _TRUNCATE);
db_free(&dbv);
diff --git a/protocols/Xfire/src/Xfire_game.cpp b/protocols/Xfire/src/Xfire_game.cpp index 186a3c91ec..7e641883b0 100644 --- a/protocols/Xfire/src/Xfire_game.cpp +++ b/protocols/Xfire/src/Xfire_game.cpp @@ -56,7 +56,7 @@ BOOL Xfire_game::start_game(char*ip, unsigned int port, char*) //port begrenzen
port = port % 65535;
//port in string wandeln
- mir_snprintf(portstr, _countof(portstr), "%d", port);
+ mir_snprintf(portstr, "%d", port);
str_replace(mynetworkparams, "%UA_GAME_HOST_NAME%", ip);
str_replace(mynetworkparams, "%UA_GAME_HOST_PORT%", portstr);
@@ -403,7 +403,7 @@ void Xfire_game::createMenuitem(unsigned int pos, int dbid) CMenuItem mi;
mi.root = Menu_CreateRoot(MO_MAIN, LPGENT("Start game"), 500084000);
- mir_snprintf(m_temp, _countof(m_temp), servicefunction, m_id);
+ mir_snprintf(m_temp, servicefunction, m_id);
//wenn die servicefunktion schon exisitert vernichten, hehe
if (ServiceExists(m_temp))
DestroyServiceFunction(m_temp);
diff --git a/protocols/Xfire/src/Xfire_icon_mng.cpp b/protocols/Xfire/src/Xfire_icon_mng.cpp index b51639d8fd..1a76b82167 100644 --- a/protocols/Xfire/src/Xfire_icon_mng.cpp +++ b/protocols/Xfire/src/Xfire_icon_mng.cpp @@ -140,7 +140,7 @@ Xfire_icon_cache Xfire_icon_mng::LoadGameIcon(unsigned int gameid) if (hIconDll) {
char resourcename[255];
//kurznamen des spiels uppercasen und .ICO anhängen
- mir_snprintf(resourcename, _countof(resourcename), "XF_%s.ICO", shortname);
+ mir_snprintf(resourcename, "XF_%s.ICO", shortname);
Xfire_base::strtoupper(resourcename);
//versuche die resource zufinden
diff --git a/protocols/Xfire/src/Xfire_voicechat.cpp b/protocols/Xfire/src/Xfire_voicechat.cpp index 732fa359ca..4417278b20 100644 --- a/protocols/Xfire/src/Xfire_voicechat.cpp +++ b/protocols/Xfire/src/Xfire_voicechat.cpp @@ -155,7 +155,7 @@ void Xfire_voicechat::writeToDatabase(SendGameStatus2Packet* packet) return;
}
//ip speichern
- mir_snprintf(temp, _countof(temp), "%d.%d.%d.%d:%d", (unsigned char)packet->ip[3], (unsigned char)packet->ip[2], (unsigned char)packet->ip[1], (unsigned char)packet->ip[0], packet->port);
+ mir_snprintf(temp, "%d.%d.%d.%d:%d", (unsigned char)packet->ip[3], (unsigned char)packet->ip[2], (unsigned char)packet->ip[1], (unsigned char)packet->ip[0], packet->port);
db_set_s(NULL, protocolname, "VServerIP", temp);
//namen jeh nach id schreiben
switch (packet->gameid) {
diff --git a/protocols/Xfire/src/addgamedialog.cpp b/protocols/Xfire/src/addgamedialog.cpp index 016c170a5c..7d789f3851 100644 --- a/protocols/Xfire/src/addgamedialog.cpp +++ b/protocols/Xfire/src/addgamedialog.cpp @@ -138,11 +138,11 @@ static void FillGameList(LPVOID hwndDlg) if (z2 != zahlbuffer2) {
listentry.gameid = MAKELONG(gameid, atoi(zahlbuffer2));
- mir_snprintf(gameidtemp, _countof(gameidtemp), "%d_%d", gameid, atoi(zahlbuffer2));
+ mir_snprintf(gameidtemp, "%d_%d", gameid, atoi(zahlbuffer2));
}
else {
listentry.gameid = gameid;
- mir_snprintf(gameidtemp, _countof(gameidtemp), "%d", gameid);
+ mir_snprintf(gameidtemp, "%d", gameid);
}
@@ -254,7 +254,7 @@ BOOL OpenFileDialog(HWND hwndDlg, OPENFILENAMEA*ofn, char*exe) //kein backslash dann normal ret als exenamen verwenden
if ((INT_PTR)exename == 1) exename = exe;
//filterstring aufbauen
- mir_snprintf(szFilter, _countof(szFilter), "%s|%s|%s|*.*|", exename, exename, Translate("All Files"));
+ mir_snprintf(szFilter, "%s|%s|%s|*.*|", exename, exename, Translate("All Files"));
//umbruch in 0 wandeln
unsigned int sizeFilter = mir_strlen(szFilter);
for (unsigned int i = 0; i < sizeFilter; i++)
@@ -325,13 +325,13 @@ INT_PTR CALLBACK DlgAddGameProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM) int gameid2 = HIWORD(gameids);
if (gameid2 != 0)
- mir_snprintf(gameidtemp, _countof(gameidtemp), "%d_%d", gameid1, gameid2);
+ mir_snprintf(gameidtemp, "%d_%d", gameid1, gameid2);
else
- mir_snprintf(gameidtemp, _countof(gameidtemp), "%d", gameid1);
+ mir_snprintf(gameidtemp, "%d", gameid1);
//spielnamen holen
if (xfire_GetPrivateProfileString(gameidtemp, "LongName", "", ret, 512, inipath)) {
- mir_snprintf(gameidtemp, _countof(gameidtemp), "%d", gameid1);
+ mir_snprintf(gameidtemp, "%d", gameid1);
//einige felder vorbelegen
SetDlgItemTextA(hPage, IDC_ADD_NAME, ret);
@@ -367,9 +367,9 @@ INT_PTR CALLBACK DlgAddGameProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM) char ret[512];
if (gameid2 != 0)
- mir_snprintf(gameidtemp, _countof(gameidtemp), "%d_%d", gameid1, gameid2);
+ mir_snprintf(gameidtemp, "%d_%d", gameid1, gameid2);
else
- mir_snprintf(gameidtemp, _countof(gameidtemp), "%d", gameid1);
+ mir_snprintf(gameidtemp, "%d", gameid1);
//neuen gameeintrag anlegen
Xfire_game* newgame = new Xfire_game();
diff --git a/protocols/Xfire/src/buddylist.cpp b/protocols/Xfire/src/buddylist.cpp index 2d267f831a..b9fec9aaeb 100644 --- a/protocols/Xfire/src/buddylist.cpp +++ b/protocols/Xfire/src/buddylist.cpp @@ -149,7 +149,7 @@ namespace xfirelib /* ## buddies im miranda verarbietn */ char temp[255]; char * dummy; - mir_snprintf(temp, _countof(temp), "Clan_%d", entry->m_clanid); + mir_snprintf(temp, "Clan_%d", entry->m_clanid); DBVARIANT dbv; if (!db_get(NULL, protocolname, temp, &dbv)) diff --git a/protocols/Xfire/src/iniupdater.cpp b/protocols/Xfire/src/iniupdater.cpp index ed3a43534e..29812cc5ac 100644 --- a/protocols/Xfire/src/iniupdater.cpp +++ b/protocols/Xfire/src/iniupdater.cpp @@ -51,11 +51,11 @@ void UpdateMyXFireIni(LPVOID) //ini pfad rausbekommen
char file[1024], file2[1024], file3[1024];
- mir_snprintf(file, _countof(file), "%sxfire_games.new", inipath);
- mir_snprintf(file2, _countof(file2), "%sxfire_games.ini", inipath);
- mir_snprintf(file3, _countof(file3), "%sxfire_games.old", inipath);
+ mir_snprintf(file, "%sxfire_games.new", inipath);
+ mir_snprintf(file2, "%sxfire_games.ini", inipath);
+ mir_snprintf(file3, "%sxfire_games.old", inipath);
- mir_snprintf(request, _countof(request), "%s%d", INI_URLREQUEST, getfilesize(file2));
+ mir_snprintf(request, "%s%d", INI_URLREQUEST, getfilesize(file2));
if (CheckWWWContent(request)) {
if (db_get_b(NULL, protocolname, "dontaskforupdate", 0) == 1 || DialogBox(hinstance, MAKEINTRESOURCE(IDD_UPDATE), NULL, DlgUpdateDialogProc) == IDOK) {
@@ -84,11 +84,11 @@ void UpdateMyIcons(LPVOID) //ini pfad rausbekommen
char file[1024], file2[1024], file3[1024];
- mir_snprintf(file, _countof(file), "%sicons.new", inipath);
- mir_snprintf(file2, _countof(file2), "%sicons.dll", inipath);
- mir_snprintf(file3, _countof(file3), "%sicons.old", inipath);
+ mir_snprintf(file, "%sicons.new", inipath);
+ mir_snprintf(file2, "%sicons.dll", inipath);
+ mir_snprintf(file3, "%sicons.old", inipath);
- mir_snprintf(request, _countof(request), "%s%d", ICO_URLREQUEST, getfilesize(file2));
+ mir_snprintf(request, "%s%d", ICO_URLREQUEST, getfilesize(file2));
if (CheckWWWContent(request)) {
if (db_get_b(NULL, protocolname, "dontaskforupdate", 0) == 1 || MessageBox(NULL, TranslateT("There is a new Icons.dll online, do you want to update now?"), TranslateT(PLUGIN_TITLE), MB_YESNO | MB_ICONQUESTION) == IDYES) {
diff --git a/protocols/Xfire/src/main.cpp b/protocols/Xfire/src/main.cpp index 6701140303..8e84db6709 100644 --- a/protocols/Xfire/src/main.cpp +++ b/protocols/Xfire/src/main.cpp @@ -419,7 +419,7 @@ void XFireClient::receivedPacket(XFirePacket *packet) ClanInvitationPacket *claninv = (ClanInvitationPacket*)content;
for (int i = 0; i < claninv->numberOfInv; i++) {
char msg[XFIRE_MAX_STATIC_STRING_LEN];
- mir_snprintf(msg, _countof(msg), Translate("%s (Nickname: %s) has invited you to join the %s clan. Message: %s%sPlease go to the XFire clan site to accept the Invitation."), claninv->invitefromusername[i].c_str(),
+ mir_snprintf(msg, Translate("%s (Nickname: %s) has invited you to join the %s clan. Message: %s%sPlease go to the XFire clan site to accept the Invitation."), claninv->invitefromusername[i].c_str(),
claninv->invitefrom[i].c_str(),
claninv->clanname[i].c_str(),
claninv->invitemsg[i].c_str(), "\n");
@@ -479,7 +479,7 @@ void XFireClient::receivedPacket(XFirePacket *packet) char temp[255];
char * dummy;
ClanBuddyListNamesPacket *clan = (ClanBuddyListNamesPacket*)content;
- mir_snprintf(temp, _countof(temp), "Clan_%d", clan->clanid);
+ mir_snprintf(temp, "Clan_%d", clan->clanid);
DBVARIANT dbv;
if (!db_get(NULL,protocolname,temp,&dbv))
@@ -623,10 +623,10 @@ void XFireClient::receivedPacket(XFirePacket *packet) XFireClanPacket *clan = (XFireClanPacket*)content;
for (int i = 0; i < clan->count; i++) {
- mir_snprintf(temp, _countof(temp), "Clan_%d", clan->clanid[i]);
+ mir_snprintf(temp, "Clan_%d", clan->clanid[i]);
db_set_s(NULL, protocolname, temp, (char*)clan->name[i].c_str());
- mir_snprintf(temp, _countof(temp), "ClanUrl_%d", clan->clanid[i]);
+ mir_snprintf(temp, "ClanUrl_%d", clan->clanid[i]);
db_set_s(NULL, protocolname, temp, (char*)clan->url[i].c_str());
if (!db_get_b(NULL, protocolname, "noclangroups", 0)) {
@@ -815,7 +815,7 @@ INT_PTR UrlCall(WPARAM, LPARAM lparam) if (mir_strlen(g) > 25) //zugroße abschneiden
*(g + 25) = 0;
- mir_snprintf(temp, _countof(temp), Translate("Do you really want to add %s to your friend list?"), g);
+ mir_snprintf(temp, Translate("Do you really want to add %s to your friend list?"), g);
//Nutzer vorher fragen, ob er wirklich user xyz adden möchte
if (MessageBoxA(NULL, temp, Translate(PLUGIN_TITLE), MB_YESNO | MB_ICONQUESTION) == IDYES) {
if (myClient != NULL) {
@@ -991,7 +991,7 @@ extern "C" __declspec(dllexport) int Load(void) //statusmessages setzen
mir_strcpy(statusmessage[0], "");
- mir_snprintf(statusmessage[1], _countof(statusmessage[1]), "(AFK) %s", Translate("Away from Keyboard"));
+ mir_snprintf(statusmessage[1], "(AFK) %s", Translate("Away from Keyboard"));
HookEvent(ME_OPT_INITIALISE, OptInit);
HookEvent(ME_SYSTEM_MODULESLOADED, OnSystemModulesLoaded);
@@ -1412,7 +1412,7 @@ INT_PTR SetStatus(WPARAM wParam, LPARAM) {
//setze bei aktivem nocustomaway die alte awaystatusmsg zurück, bugfix
if (db_get_b(NULL, protocolname, "nocustomaway", 0))
- mir_snprintf(statusmessage[1], _countof(statusmessage[1]), "(AFK) %s", Translate("Away from Keyboard"));
+ mir_snprintf(statusmessage[1], "(AFK) %s", Translate("Away from Keyboard"));
myClient->Status(statusmessage[1]);
}
@@ -1783,7 +1783,7 @@ static INT_PTR GetIPPort(WPARAM hContact, LPARAM) return 0;
char temp[XFIRE_MAX_STATIC_STRING_LEN];
- mir_snprintf(temp, _countof(temp), "%s:%d", dbv.pszVal, db_get_w(hContact, protocolname, "Port", -1));
+ mir_snprintf(temp, "%s:%d", dbv.pszVal, db_get_w(hContact, protocolname, "Port", -1));
db_free(&dbv);
if (OpenClipboard(NULL)) {
@@ -1811,7 +1811,7 @@ static INT_PTR GetVIPPort(WPARAM hContact, LPARAM) return 0;
char temp[XFIRE_MAX_STATIC_STRING_LEN];
- mir_snprintf(temp, _countof(temp), "%s:%d", dbv.pszVal, db_get_w(hContact, protocolname, "VPort", -1));
+ mir_snprintf(temp, "%s:%d", dbv.pszVal, db_get_w(hContact, protocolname, "VPort", -1));
db_free(&dbv);
if (OpenClipboard(NULL)) {
@@ -1850,7 +1850,7 @@ static INT_PTR GotoXFireClanSite(WPARAM hContact, LPARAM) char temp[64] = "";
int clanid = db_get_dw(hContact, protocolname, "Clan", -1);
- mir_snprintf(temp, _countof(temp), "ClanUrl_%d", clanid);
+ mir_snprintf(temp, "ClanUrl_%d", clanid);
if (db_get_s(NULL, protocolname, temp, &dbv))
return 0;
@@ -2125,7 +2125,7 @@ void gamedetectiont(void*) if (GetServerIPPort(pid, myClient->m_client->m_localaddr, myClient->m_client->m_llocaladdr, &packet->ip[3], &packet->ip[2], &packet->ip[1], &packet->ip[0], &packet->port)) {
if (packet->ip[3] != 0) {
- mir_snprintf(temp, _countof(temp), "%d.%d.%d.%d:%d", (unsigned char)packet->ip[3], (unsigned char)packet->ip[2], (unsigned char)packet->ip[1], (unsigned char)packet->ip[0], packet->port);
+ mir_snprintf(temp, "%d.%d.%d.%d:%d", (unsigned char)packet->ip[3], (unsigned char)packet->ip[2], (unsigned char)packet->ip[1], (unsigned char)packet->ip[0], packet->port);
db_set_s(NULL, protocolname, "ServerIP", temp);
XFireLog("Got IPPort: %s", temp);
}
@@ -2368,7 +2368,7 @@ MCONTACT handlingBuddys(BuddyListEntry *entry, int clan, char*group, BOOL dontsc if (gameob) {
if ((unsigned char)gameob->m_ip[3] != 0) { // wenn ip, dann speichern
- mir_snprintf(temp, _countof(temp), "%d.%d.%d.%d", (unsigned char)gameob->m_ip[3], (unsigned char)gameob->m_ip[2], (unsigned char)gameob->m_ip[1], (unsigned char)gameob->m_ip[0]);
+ mir_snprintf(temp, "%d.%d.%d.%d", (unsigned char)gameob->m_ip[3], (unsigned char)gameob->m_ip[2], (unsigned char)gameob->m_ip[1], (unsigned char)gameob->m_ip[0]);
db_set_s(hContact, protocolname, "VServerIP", temp);
db_set_w(hContact, protocolname, "VPort", gameob->m_port);
}
@@ -2404,7 +2404,7 @@ MCONTACT handlingBuddys(BuddyListEntry *entry, int clan, char*group, BOOL dontsc //popup, wenn jemand was spielt
if (db_get_b(NULL, protocolname, "gamepopup", 0) == 1) {
char szMsg[256] = "";
- mir_snprintf(szMsg, _countof(szMsg), Translate("%s is playing %s."),
+ mir_snprintf(szMsg, Translate("%s is playing %s."),
//ist ein nick gesetzt?
(entry->m_nick.length() == 0 ?
//nein dann username
@@ -2415,7 +2415,7 @@ MCONTACT handlingBuddys(BuddyListEntry *entry, int clan, char*group, BOOL dontsc if (gameob) {
if ((unsigned char)gameob->m_ip[3] != 0) {
- mir_snprintf(szMsg, _countof(szMsg), Translate("%s is playing %s on server %d.%d.%d.%d:%d."),
+ mir_snprintf(szMsg, Translate("%s is playing %s on server %d.%d.%d.%d:%d."),
//ist ein nick gesetzt?
(entry->m_nick.length() == 0 ?
//nein dann username
@@ -2460,7 +2460,7 @@ MCONTACT handlingBuddys(BuddyListEntry *entry, int clan, char*group, BOOL dontsc if (gameob) {
if ((unsigned char)gameob->m_ip[3] != 0) {
//ip und port in kontakt speichern
- mir_snprintf(temp, _countof(temp), "%d.%d.%d.%d", (unsigned char)gameob->m_ip[3], (unsigned char)gameob->m_ip[2], (unsigned char)gameob->m_ip[1], (unsigned char)gameob->m_ip[0]);
+ mir_snprintf(temp, "%d.%d.%d.%d", (unsigned char)gameob->m_ip[3], (unsigned char)gameob->m_ip[2], (unsigned char)gameob->m_ip[1], (unsigned char)gameob->m_ip[0]);
db_set_s(hContact, protocolname, "ServerIP", temp);
db_set_w(hContact, protocolname, "Port", gameob->m_port);
@@ -2572,10 +2572,10 @@ MCONTACT handlingBuddys(BuddyListEntry *entry, int clan, char*group, BOOL dontsc else {
char temp[256];
DBVARIANT dbv;
- mir_snprintf(temp, _countof(temp), "%d", val - 1);
+ mir_snprintf(temp, "%d", val - 1);
db_get_s(NULL, "CListGroups", temp, &dbv);
if (dbv.pszVal != NULL) {
- mir_snprintf(temp, _countof(temp), "%s\\%s", &dbv.pszVal[1], group);
+ mir_snprintf(temp, "%s\\%s", &dbv.pszVal[1], group);
db_set_s(entry->m_hcontact, "CList", "Group", temp);
db_free(&dbv);
}
@@ -2592,10 +2592,10 @@ MCONTACT handlingBuddys(BuddyListEntry *entry, int clan, char*group, BOOL dontsc else {
char temp[256];
DBVARIANT dbv;
- mir_snprintf(temp, _countof(temp), "%d", val - 1);
+ mir_snprintf(temp, "%d", val - 1);
db_get_s(NULL, "CListGroups", temp, &dbv);
if (dbv.pszVal != NULL) {
- mir_snprintf(temp, _countof(temp), "%s\\%s", &dbv.pszVal[1], group);
+ mir_snprintf(temp, "%s\\%s", &dbv.pszVal[1], group);
db_set_s(entry->m_hcontact, "CList", "Group", temp);
db_free(&dbv);
}
@@ -2693,9 +2693,9 @@ void CreateGroup(char*grpn, char*field) strcpy_s(grp, _countof(grp), grpn);//((char*)clan->name[i].c_str());
else {
char temp[255];
- mir_snprintf(temp, _countof(temp), "%d", val - 1);
+ mir_snprintf(temp, "%d", val - 1);
if (!db_get_s(NULL, "CListGroups", temp, &dbv)) {
- mir_snprintf(grp, _countof(grp), "%s\\%s", &dbv.pszVal[1], grpn);
+ mir_snprintf(grp, "%s\\%s", &dbv.pszVal[1], grpn);
db_free(&dbv);
}
else { //gruppe existiert nciht mehr, auf root alles legen
@@ -2709,7 +2709,7 @@ void CreateGroup(char*grpn, char*field) char temp[10];
int i = 0;
for (i = 0;; i++) {
- mir_snprintf(temp, _countof(temp), "%d", i);
+ mir_snprintf(temp, "%d", i);
if (db_get_s(NULL, "CListGroups", temp, &dbv)) {
i--;
break;
@@ -2723,7 +2723,7 @@ void CreateGroup(char*grpn, char*field) strcpy_s(group, 255, "D");
strcat_s(group, 255, grp);
group[0] = 1 | GROUPF_EXPANDED;
- mir_snprintf(temp, _countof(temp), "%d", i + 1);
+ mir_snprintf(temp, "%d", i + 1);
db_set_s(NULL, "CListGroups", temp, group);
CallServiceSync(MS_CLUI_GROUPADDED, i + 1, 0);
}
@@ -2736,17 +2736,16 @@ INT_PTR SetAwayMsg(WPARAM wParam, LPARAM lParam) if (wParam == ID_STATUS_ONLINE)
mir_strcpy(statusmessage[0], "");
else if (wParam != ID_STATUS_OFFLINE)
- mir_snprintf(statusmessage[1], _countof(statusmessage[1]), "(AFK) %s", Translate("Away from Keyboard"));
+ mir_snprintf(statusmessage[1], "(AFK) %s", Translate("Away from Keyboard"));
}
else {
if (wParam == ID_STATUS_ONLINE)
mir_strcpy(statusmessage[0], (char*)lParam);
else if (wParam != ID_STATUS_OFFLINE) {
- if (db_get_b(NULL, protocolname, "nocustomaway", 0) == 0 && mir_strlen((char*)lParam) > 0) {
- mir_snprintf(statusmessage[1], _countof(statusmessage[1]), "(AFK) %s", (char*)lParam);
- //mir_strcpy(statusmessage[1],( char* )lParam);
- }
- else mir_snprintf(statusmessage[1], _countof(statusmessage[1]), "(AFK) %s", Translate("Away from Keyboard"));
+ if (db_get_b(NULL, protocolname, "nocustomaway", 0) == 0 && mir_strlen((char*)lParam) > 0)
+ mir_snprintf(statusmessage[1], "(AFK) %s", (char*)lParam);
+ else
+ mir_snprintf(statusmessage[1], "(AFK) %s", Translate("Away from Keyboard"));
}
}
@@ -2832,7 +2831,7 @@ INT_PTR RemoveFriend(WPARAM hContact, LPARAM) char temp[256];
DBVARIANT dbv;
if (!db_get_s(hContact, protocolname, "Username", &dbv)) {
- mir_snprintf(temp, _countof(temp), Translate("Do you really want to delete your friend %s?"), dbv.pszVal);
+ mir_snprintf(temp, Translate("Do you really want to delete your friend %s?"), dbv.pszVal);
if (MessageBoxA(NULL, temp, Translate("Confirm Delete"), MB_YESNO | MB_ICONQUESTION) == IDYES) {
if (myClient != NULL) {
if (myClient->m_client->m_connected) {
@@ -2923,7 +2922,7 @@ int doneQuery(WPARAM wParam, LPARAM lParam) db_set_s(bud->m_hcontact, protocolname, "ServerName", gameinfo->name);
db_set_s(bud->m_hcontact, protocolname, "GameType", gameinfo->gametype);
db_set_s(bud->m_hcontact, protocolname, "Map", gameinfo->map);
- mir_snprintf(temp, _countof(temp), "(%d/%d)", gameinfo->players, gameinfo->maxplayers);
+ mir_snprintf(temp, "(%d/%d)", gameinfo->players, gameinfo->maxplayers);
db_set_s(bud->m_hcontact, protocolname, "Players", temp);
db_set_b(bud->m_hcontact, protocolname, "Passworded", gameinfo->password);
diff --git a/protocols/Xfire/src/options.cpp b/protocols/Xfire/src/options.cpp index efde5c0404..a1ff71418f 100644 --- a/protocols/Xfire/src/options.cpp +++ b/protocols/Xfire/src/options.cpp @@ -177,7 +177,7 @@ static INT_PTR CALLBACK DlgProcOpts2(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR } char temp[255] = ""; - mir_snprintf(temp, _countof(temp), "%d", db_get_b(NULL, protocolname, "protover", 0x5b)); + mir_snprintf(temp, "%d", db_get_b(NULL, protocolname, "protover", 0x5b)); SetDlgItemTextA(hwndDlg, IDC_PVER, temp); EnableWindow(GetDlgItem(hwndDlg, IDC_LASTGAME), FALSE); @@ -363,10 +363,10 @@ static INT_PTR CALLBACK DlgProcOpts3(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR SendDlgItemMessage(hwndDlg, IDC_CLANGROUP, CB_ADDSTRING, 0, (LPARAM)TranslateT("<Root Group>")); SendDlgItemMessage(hwndDlg, IDC_FOFGROUP, CB_ADDSTRING, 0, (LPARAM)TranslateT("<Root Group>")); - mir_snprintf(temp, _countof(temp), "%d", gruppen_id); + mir_snprintf(temp, "%d", gruppen_id); while (!db_get_s(NULL, "CListGroups", temp, &dbv)) { gruppen_id++; - mir_snprintf(temp, _countof(temp), "%d", gruppen_id); + mir_snprintf(temp, "%d", gruppen_id); if (dbv.pszVal != NULL) { SendDlgItemMessageA(hwndDlg, IDC_CLANGROUP, CB_ADDSTRING, 0, (LPARAM)&dbv.pszVal[1]); @@ -729,7 +729,7 @@ static INT_PTR CALLBACK DlgProcOpts6(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR char temp[XFIRE_MAXSIZEOFGAMENAME]; for (int i = 0; i < found; i++) { //id auslesen - mir_snprintf(temp, _countof(temp), "gameid_%d", i); + mir_snprintf(temp, "gameid_%d", i); int gameid = db_get_w(NULL, protocolname, temp, 0); //spielnamen auslesen xgamelist.getGamename(gameid, temp, XFIRE_MAXSIZEOFGAMENAME); @@ -859,17 +859,17 @@ static INT_PTR CALLBACK DlgProcOpts6(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR //gameskip wert setzen char temp[64] = ""; - mir_snprintf(temp, _countof(temp), "gameskip_%d", gameid); + mir_snprintf(temp, "gameskip_%d", gameid); CheckDlgButton(hwndDlg, IDC_DONTDETECT, db_get_b(NULL, protocolname, temp, 0) ? BST_CHECKED : BST_UNCHECKED); - mir_snprintf(temp, _countof(temp), "gamenostatus_%d", gameid); + mir_snprintf(temp, "gamenostatus_%d", gameid); CheckDlgButton(hwndDlg, IDC_NOSTATUSMSG, db_get_b(NULL, protocolname, temp, 0) ? BST_CHECKED : BST_UNCHECKED); - mir_snprintf(temp, _countof(temp), "notinstartmenu_%d", gameid); + mir_snprintf(temp, "notinstartmenu_%d", gameid); CheckDlgButton(hwndDlg, IDC_NOTINSTARTMENU, db_get_b(NULL, protocolname, temp, 0) ? BST_CHECKED : BST_UNCHECKED); //extra parameter auslesen, aber nur, wenn das spiel auch sowas unterstützt if (xgtemp && xgtemp->haveExtraGameArgs()) { EnableDlgItem(hwndDlg, IDC_EXTRAPARAMS, TRUE); - mir_snprintf(temp, _countof(temp), "gameextraparams_%d", gameid); + mir_snprintf(temp, "gameextraparams_%d", gameid); DBVARIANT dbv; if (!db_get(NULL, protocolname, temp, &dbv)) { SetDlgItemTextA(hwndDlg, IDC_EXTRAPARAMS, dbv.pszVal); diff --git a/protocols/Xfire/src/processbuddyinfo.cpp b/protocols/Xfire/src/processbuddyinfo.cpp index 0a48997f31..6fd8961477 100644 --- a/protocols/Xfire/src/processbuddyinfo.cpp +++ b/protocols/Xfire/src/processbuddyinfo.cpp @@ -45,7 +45,7 @@ void ProcessBuddyInfo(xfirelib::BuddyInfoPacket *buddyinfo, MCONTACT hcontact, c mir_strcat(filename, ".gif");
type = PA_FORMAT_GIF;
- mir_snprintf(temp, _countof(temp), "/xfire/xf/images/avatars/gallery/default/%03d.gif", buddyinfo->avatarid);
+ mir_snprintf(temp, "/xfire/xf/images/avatars/gallery/default/%03d.gif", buddyinfo->avatarid);
dl = GetWWWContent("media.xfire.com", temp, filename, FALSE);
break;
@@ -54,7 +54,7 @@ void ProcessBuddyInfo(xfirelib::BuddyInfoPacket *buddyinfo, MCONTACT hcontact, c mir_strcat(filename, ".jpg");
type = PA_FORMAT_JPEG;
- mir_snprintf(temp, _countof(temp), "/avatar/100/%s.jpg?%d", username, buddyinfo->avatarid);
+ mir_snprintf(temp, "/avatar/100/%s.jpg?%d", username, buddyinfo->avatarid);
dl = GetWWWContent("screenshot.xfire.com", temp, filename, FALSE);
break;
@@ -62,7 +62,7 @@ void ProcessBuddyInfo(xfirelib::BuddyInfoPacket *buddyinfo, MCONTACT hcontact, c type = PA_FORMAT_GIF;
mir_strcat(filename, "xfire.gif");
- mir_snprintf(temp, _countof(temp), "/xfire/xf/images/avatars/gallery/default/xfire.gif", buddyinfo->avatarid);
+ mir_snprintf(temp, "/xfire/xf/images/avatars/gallery/default/xfire.gif", buddyinfo->avatarid);
dl = GetWWWContent("media.xfire.com", temp, filename, TRUE);
break;
diff --git a/protocols/Xfire/src/searching4games.cpp b/protocols/Xfire/src/searching4games.cpp index c9b5192da4..1acf1fcf36 100644 --- a/protocols/Xfire/src/searching4games.cpp +++ b/protocols/Xfire/src/searching4games.cpp @@ -231,9 +231,9 @@ void Scan4Games(LPVOID) while (notfound < 200) {
//2 gameids?
if (split)
- mir_snprintf(temp, _countof(temp), "%i_%i", i, i2);
+ mir_snprintf(temp, "%i_%i", i, i2);
else
- mir_snprintf(temp, _countof(temp), "%i", i);
+ mir_snprintf(temp, "%i", i);
//MessageBox(0,temp,temp,0);
@@ -411,7 +411,7 @@ void Scan4Games(LPVOID) if (multiexe) {
multiexe = FALSE;
for (int j = 1; j < 9; j++) {
- mir_snprintf(ret, _countof(ret), "DetectExe[%d]", j);
+ mir_snprintf(ret, "DetectExe[%d]", j);
if (xfire_GetPrivateProfileString(temp, ret, "", ret2, 512, inipath)) {
char *p = strrchr(path, '\\');
if (p != 0) {
@@ -488,7 +488,7 @@ void Scan4Games(LPVOID) newgame->setString(ret2, &newgame->m_launchparams);
//soll alle string, welche nicht in der commandline eines spiels sein soll in einen string pakcen semikolon getrennt
- mir_snprintf(ret, _countof(ret), "CommandLineMustNotContain[0]");
+ mir_snprintf(ret, "CommandLineMustNotContain[0]");
int k = 0;
while (xfire_GetPrivateProfileString(temp, ret, "", ret2, 512, inipath)) {
@@ -498,7 +498,7 @@ void Scan4Games(LPVOID) newgame->appendString(ret2, &newgame->m_notcontain);
k++;
- mir_snprintf(ret, _countof(ret), "CommandLineMustNotContain[%d]", k);
+ mir_snprintf(ret, "CommandLineMustNotContain[%d]", k);
}
newgame->setNameandIcon();
@@ -583,7 +583,7 @@ void Scan4Games(LPVOID) newgame->m_setstatusmsg = atoi(ret2);
//soll alle string, welche nicht in der commandline eines spiels sein soll in einen string pakcen semikolon getrennt
- mir_snprintf(ret, _countof(ret), "CommandLineMustNotContain[0]");
+ mir_snprintf(ret, "CommandLineMustNotContain[0]");
int k = 0;
while (xfire_GetPrivateProfileString(temp, ret, "", ret2, 512, inipath)) {
@@ -593,7 +593,7 @@ void Scan4Games(LPVOID) newgame->appendString(ret2, &newgame->m_notcontain);
k++;
- mir_snprintf(ret, _countof(ret), "CommandLineMustNotContain[%d]", k);
+ mir_snprintf(ret, "CommandLineMustNotContain[%d]", k);
}
newgame->setNameandIcon();
@@ -653,7 +653,7 @@ void Scan4Games(LPVOID) int p = mir_strlen(gamelist) - 2;
if (p > -1)
gamelist[p] = 0; //letztes koma killen
- mir_snprintf(ret, _countof(ret), Translate("Games found:%s%s"), "\r\n\r\n", gamelist);
+ mir_snprintf(ret, Translate("Games found:%s%s"), "\r\n\r\n", gamelist);
MSGBOX(ret);
}
diff --git a/protocols/Xfire/src/userdetails.cpp b/protocols/Xfire/src/userdetails.cpp index aa4de637c3..9adabebebc 100644 --- a/protocols/Xfire/src/userdetails.cpp +++ b/protocols/Xfire/src/userdetails.cpp @@ -45,7 +45,7 @@ void LoadProfilStatus(void *arg) //dl
char url[255];
- mir_snprintf(url, _countof(url), "http://miniprofile.xfire.com/bg/sh/type/1/%s.png", fname);
+ mir_snprintf(url, "http://miniprofile.xfire.com/bg/sh/type/1/%s.png", fname);
char* buf = NULL;
unsigned int size = 0;
@@ -66,7 +66,7 @@ void SetItemTxt(HWND hwndDlg, int feldid, char*feld, MCONTACT hcontact, int type if (!db_get(hcontact, protocolname, feld, &dbv)) {
if (type == 1) {
char temp[255];
- mir_snprintf(temp, _countof(temp), "%i", dbv.wVal);
+ mir_snprintf(temp, "%i", dbv.wVal);
SetDlgItemTextA(hwndDlg, feldid, temp);
}
else {
@@ -91,7 +91,7 @@ static int GetIPPortUDetails(MCONTACT hContact, char* feld1, char* feld2) return 0;
char temp[255];
- mir_snprintf(temp, _countof(temp), "%s:%d", dbv.pszVal, db_get_w(hContact, protocolname, feld2, -1));
+ mir_snprintf(temp, "%s:%d", dbv.pszVal, db_get_w(hContact, protocolname, feld2, -1));
db_free(&dbv);
if (OpenClipboard(NULL)) {
diff --git a/protocols/Xfire/src/variables.cpp b/protocols/Xfire/src/variables.cpp index e3b7eabedc..879bb9e6b6 100644 --- a/protocols/Xfire/src/variables.cpp +++ b/protocols/Xfire/src/variables.cpp @@ -102,7 +102,7 @@ char* Varxfireserverip(ARGUMENTSINFO *ai) char temp[24];
DBVARIANT dbv3;
if (!db_get(ai->fi->hContact, protocolname, "ServerIP", &dbv3)) {
- mir_snprintf(temp, _countof(temp), "%s:%d", dbv3.pszVal, db_get_w(ai->fi->hContact, protocolname, "Port", 0));
+ mir_snprintf(temp, "%s:%d", dbv3.pszVal, db_get_w(ai->fi->hContact, protocolname, "Port", 0));
db_free(&dbv3);
return mir_strdup(temp);
}
@@ -125,7 +125,7 @@ char* Varxfirevoiceip(ARGUMENTSINFO *ai) char temp[24];
DBVARIANT dbv3;
if (!db_get(ai->fi->hContact, protocolname, "VServerIP", &dbv3)) {
- mir_snprintf(temp, _countof(temp), "%s:%d", dbv3.pszVal, db_get_w(ai->fi->hContact, protocolname, "VPort", 0));
+ mir_snprintf(temp, "%s:%d", dbv3.pszVal, db_get_w(ai->fi->hContact, protocolname, "VPort", 0));
db_free(&dbv3);
return mir_strdup(temp);
}
diff --git a/protocols/Yahoo/src/chat.cpp b/protocols/Yahoo/src/chat.cpp index 7daff87be5..f80fa58e97 100644 --- a/protocols/Yahoo/src/chat.cpp +++ b/protocols/Yahoo/src/chat.cpp @@ -54,7 +54,7 @@ void ext_yahoo_conf_userdecline(int id, const char*, const char *who, const char TCHAR info[1024];
TCHAR *whot = mir_utf8decodeT(who);
TCHAR *msgt = mir_utf8decodeT(msg);
- mir_sntprintf(info, _countof(info), TranslateT("%s denied invitation with message: %s"), whot, msgt ? msgt : _T(""));
+ mir_sntprintf(info, TranslateT("%s denied invitation with message: %s"), whot, msgt ? msgt : _T(""));
GETPROTOBYID(id)->ChatEvent(room, who, GC_EVENT_INFORMATION, info);
mir_free(msgt);
mir_free(whot);
@@ -570,7 +570,7 @@ INT_PTR CALLBACK ChatRequestDialog(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA INT_PTR __cdecl CYahooProto::CreateConference(WPARAM /*wParam*/, LPARAM /*lParam*/)
{
char room[128];
- mir_snprintf(room, _countof(room), "%s-%u", m_yahoo_id, time(NULL));
+ mir_snprintf(room, "%s-%u", m_yahoo_id, time(NULL));
InviteChatParam* param = new InviteChatParam(room, this);
DialogBoxParam(hInstance, MAKEINTRESOURCE(IDD_CHATROOM_INVITE), NULL,
@@ -587,7 +587,7 @@ void CALLBACK ConferenceRequestCB(PVOID pParam) void ext_yahoo_got_conf_invite(int id, const char *me, const char *who, const char *room, const char *msg, YList *members)
{
char z[1024];
- mir_snprintf(z, _countof(z), Translate("[miranda] Got conference invite to room: %s with msg: %s"), room ? room : "", msg ? msg : "");
+ mir_snprintf(z, Translate("[miranda] Got conference invite to room: %s with msg: %s"), room ? room : "", msg ? msg : "");
LOG(("[ext_yahoo_got_conf_invite] %s", z));
CYahooProto* ppro = getProtoById(id);
diff --git a/protocols/Yahoo/src/file_transfer.cpp b/protocols/Yahoo/src/file_transfer.cpp index f5e9dde563..058086921e 100644 --- a/protocols/Yahoo/src/file_transfer.cpp +++ b/protocols/Yahoo/src/file_transfer.cpp @@ -297,7 +297,7 @@ static void dl_file(int id, INT_PTR fd, int error, const char*, unsigned long si *
* Don't rely on workingDir to be right, since it's not used to check if file exists.
*/
- mir_sntprintf(filefull, _countof(filefull), _T("%s\\%s"), sf->pfts.tszWorkingDir, sf->pfts.tszCurrentFile);
+ mir_sntprintf(filefull, _T("%s\\%s"), sf->pfts.tszWorkingDir, sf->pfts.tszCurrentFile);
FREE(sf->pfts.tszCurrentFile);
sf->pfts.tszCurrentFile = _tcsdup(filefull);
@@ -543,7 +543,7 @@ void CYahooProto::ext_got_files(const char *me, const char *who, const char *ft_ char z[1024];
yahoo_file_info *fi = (yahoo_file_info *) f->data;
- mir_snprintf(z, _countof(z), "%s (%lu)\r\n", fi->filename, fi->filesize);
+ mir_snprintf(z, "%s (%lu)\r\n", fi->filename, fi->filesize);
mir_strcat(fn, z);
fc++;
}
diff --git a/protocols/Yahoo/src/icolib.cpp b/protocols/Yahoo/src/icolib.cpp index f647d3887c..fc9144d14b 100644 --- a/protocols/Yahoo/src/icolib.cpp +++ b/protocols/Yahoo/src/icolib.cpp @@ -36,7 +36,7 @@ void CYahooProto::IconsInit(void) HICON CYahooProto::LoadIconEx(const char* name, bool big)
{
char szSettingName[100];
- mir_snprintf(szSettingName, _countof(szSettingName), "YAHOO_%s", name);
+ mir_snprintf(szSettingName, "YAHOO_%s", name);
return IcoLib_GetIcon(szSettingName, big);
}
@@ -52,6 +52,6 @@ HANDLE CYahooProto::GetIconHandle(int iconId) void CYahooProto::ReleaseIconEx(const char* name, bool big)
{
char szSettingName[100];
- mir_snprintf(szSettingName, _countof(szSettingName), "YAHOO_%s", name);
+ mir_snprintf(szSettingName, "YAHOO_%s", name);
IcoLib_Release(szSettingName, big);
}
diff --git a/protocols/Yahoo/src/im.cpp b/protocols/Yahoo/src/im.cpp index 29d980c996..398dfda62a 100644 --- a/protocols/Yahoo/src/im.cpp +++ b/protocols/Yahoo/src/im.cpp @@ -40,7 +40,7 @@ void CYahooProto::ext_got_im(const char *me, const char *who, int protocol, cons if (stat == 2) {
char z[1024];
- mir_snprintf(z, _countof(z), "Error sending message to %s", who);
+ mir_snprintf(z, "Error sending message to %s", who);
LOG((z));
ShowError(TranslateT("Yahoo Error"), _A2T(z));
return;
diff --git a/protocols/Yahoo/src/proto.cpp b/protocols/Yahoo/src/proto.cpp index eb84f7dd0e..dd2ecdb1b9 100644 --- a/protocols/Yahoo/src/proto.cpp +++ b/protocols/Yahoo/src/proto.cpp @@ -68,7 +68,7 @@ int CYahooProto::OnModulesLoadedEx(WPARAM, LPARAM) HookProtoEvent(ME_CLIST_PREBUILDCONTACTMENU, &CYahooProto::OnPrebuildContactMenu);
TCHAR tModuleDescr[100];
- mir_sntprintf(tModuleDescr, _countof(tModuleDescr), TranslateT("%s plugin connections"), m_tszUserName);
+ mir_sntprintf(tModuleDescr, TranslateT("%s plugin connections"), m_tszUserName);
NETLIBUSER nlu = { 0 };
nlu.cbSize = sizeof(nlu);
diff --git a/protocols/Yahoo/src/services.cpp b/protocols/Yahoo/src/services.cpp index 158f024364..f4bc06cf05 100644 --- a/protocols/Yahoo/src/services.cpp +++ b/protocols/Yahoo/src/services.cpp @@ -224,7 +224,7 @@ void CYahooProto::OpenURL(const char *url, int autoLogin) y = yahoo_urlencode(yahoo_get_cookie(m_id, "y"));
t = yahoo_urlencode(yahoo_get_cookie(m_id, "t"));
u = yahoo_urlencode(url);
- mir_snprintf(tUrl, _countof(tUrl),
+ mir_snprintf(tUrl,
"http://msg.edit.yahoo.com/config/reset_cookies?&.y=Y=%s&.t=T=%s&.ver=2&.done=http%%3a//us.rd.yahoo.com/messenger/client/%%3f%s",
y, t, u);
@@ -233,7 +233,7 @@ void CYahooProto::OpenURL(const char *url, int autoLogin) FREE(u);
}
else {
- mir_snprintf(tUrl, _countof(tUrl), url);
+ mir_snprintf(tUrl, url);
}
debugLogA("[YahooOpenURL] url: %s Final URL: %s", url, tUrl);
@@ -258,7 +258,7 @@ INT_PTR __cdecl CYahooProto::OnShowProfileCommand(WPARAM wParam, LPARAM) if (getString(wParam, YAHOO_LOGINID, &dbv))
return 0;
- mir_snprintf(tUrl, _countof(tUrl), "http://profiles.yahoo.com/%s", dbv.pszVal);
+ mir_snprintf(tUrl, "http://profiles.yahoo.com/%s", dbv.pszVal);
db_free(&dbv);
OpenURL(tUrl, 0);
@@ -284,7 +284,7 @@ INT_PTR __cdecl CYahooProto::OnShowMyProfileCommand(WPARAM, LPARAM) }
char tUrl[4096];
- mir_snprintf(tUrl, _countof(tUrl), "http://profiles.yahoo.com/%s", dbv.pszVal);
+ mir_snprintf(tUrl, "http://profiles.yahoo.com/%s", dbv.pszVal);
db_free(&dbv);
OpenURL(tUrl, 0);
diff --git a/protocols/Yahoo/src/yahoo.cpp b/protocols/Yahoo/src/yahoo.cpp index e42c892797..df465c1668 100644 --- a/protocols/Yahoo/src/yahoo.cpp +++ b/protocols/Yahoo/src/yahoo.cpp @@ -521,7 +521,7 @@ void CYahooProto::ext_got_audible(const char *me, const char *who, const char *a }
char z[1028];
- mir_snprintf(z, _countof(z), "[miranda-audible] %s", msg ? msg : "");
+ mir_snprintf(z, "[miranda-audible] %s", msg ? msg : "");
ext_got_im((char*)me, (char*)who, 0, z, 0, 0, 1, -1, NULL, 0);
}
@@ -735,7 +735,7 @@ void CYahooProto::ext_contact_added(const char *myid, const char *who, const cha nick[0] = '\0';
if (lname && fname)
- mir_snprintf(nick, _countof(nick), "%s %s", fname, lname);
+ mir_snprintf(nick, "%s %s", fname, lname);
else if (lname)
strncpy_s(nick, lname, _TRUNCATE);
else if (fname)
@@ -926,15 +926,15 @@ void CYahooProto::ext_mail_notify(const char *from, const char *subj, int cnt) TCHAR z[MAX_SECONDLINE], title[MAX_CONTACTNAME];
if (from == NULL) {
- mir_sntprintf(title, _countof(title), _T("%s: %s"), m_tszUserName, TranslateT("New Mail"));
- mir_sntprintf(z, _countof(z), TranslateT("You have %i unread messages"), cnt);
+ mir_sntprintf(title, _T("%s: %s"), m_tszUserName, TranslateT("New Mail"));
+ mir_sntprintf(z, TranslateT("You have %i unread messages"), cnt);
}
else {
- mir_sntprintf(title, _countof(title), TranslateT("New Mail (%i messages)"), cnt);
+ mir_sntprintf(title, TranslateT("New Mail (%i messages)"), cnt);
ptrT tszFrom(mir_utf8decodeT(from));
ptrT tszSubj(mir_utf8decodeT(subj));
- mir_sntprintf(z, _countof(z), TranslateT("From: %s\nSubject: %s"), (TCHAR*)tszFrom, (TCHAR*)tszSubj);
+ mir_sntprintf(z, TranslateT("From: %s\nSubject: %s"), (TCHAR*)tszFrom, (TCHAR*)tszSubj);
}
if (!ShowPopup(title, z, "http://mail.yahoo.com"))
@@ -986,7 +986,7 @@ void ext_yahoo_got_cookies(int id) //wsprintfA(z, "Cookie: %s; C=%s; Y=%s; T=%s", Bcookie, yahoo_get_cookie(id, "c"), yahoo_get_cookie(id, "y"), yahoo_get_cookie(id, "t"));
//wsprintfA(z, "Cookie: %s; Y=%s", Bcookie, yahoo_get_cookie(id, "y"), yahoo_get_cookie(id, "t"));
- mir_snprintf(z, _countof(z), "Cookie: Y=%s; T=%s", yahoo_get_cookie(id, "y"), yahoo_get_cookie(id, "t"));
+ mir_snprintf(z, "Cookie: Y=%s; T=%s", yahoo_get_cookie(id, "y"), yahoo_get_cookie(id, "t"));
LOG(("Our Cookie: '%s'", z));
CallService(MS_NETLIB_SETSTICKYHEADERS, (WPARAM)hnuMain, (LPARAM)z);*/
@@ -995,7 +995,7 @@ void ext_yahoo_got_cookies(int id) char z[1024];
// need to add Cookie header to our requests or we get booted w/ "Bad Cookie" message.
- mir_snprintf(z, _countof(z), "Cookie: Y=%s; T=%s; C=%s", yahoo_get_cookie(id, "y"),
+ mir_snprintf(z, "Cookie: Y=%s; T=%s; C=%s", yahoo_get_cookie(id, "y"),
yahoo_get_cookie(id, "t"), yahoo_get_cookie(id, "c"));
LOG(("Our Cookie: '%s'", z));
CallService(MS_NETLIB_SETSTICKYHEADERS, (WPARAM)hNetlibUser, (LPARAM)z);
@@ -1237,7 +1237,7 @@ void CYahooProto::ext_send_http_request(enum yahoo_connection_type type, const c if (nlhr.requestType == REQUEST_POST) {
httpHeaders[nlhr.headersCount].szName = "Content-Length";
- mir_snprintf(z, _countof(z), "%d", content_length);
+ mir_snprintf(z, "%d", content_length);
httpHeaders[nlhr.headersCount].szValue = z;
nlhr.headersCount++;
@@ -1381,7 +1381,7 @@ char * CYahooProto::ext_send_https_request(yahoo_data *yd, const char *host, con char z[4096], *result = NULL;
int i;
- mir_snprintf(z, _countof(z), "https://%s%s", host, path);
+ mir_snprintf(z, "https://%s%s", host, path);
nlhr.cbSize = sizeof(nlhr);
nlhr.requestType = REQUEST_GET;
nlhr.flags = NLHRF_HTTP11 | NLHRF_NODUMPSEND | NLHRF_DUMPASTEXT; /* Use HTTP/1.1 and don't dump the requests to the log */
@@ -1454,7 +1454,7 @@ void CYahooProto::ext_login(enum yahoo_status login_mode) NETLIBHTTPREQUEST nlhr = { 0 }, *nlhrReply;
char z[4096];
- mir_snprintf(z, _countof(z), "http://%s%s", getByte("YahooJapan", 0) != 0 ? "cs1.msg.vip.ogk.yahoo.co.jp" : "vcs.msg.yahoo.com", "/capacity");
+ mir_snprintf(z, "http://%s%s", getByte("YahooJapan", 0) != 0 ? "cs1.msg.vip.ogk.yahoo.co.jp" : "vcs.msg.yahoo.com", "/capacity");
nlhr.cbSize = sizeof(nlhr);
nlhr.requestType = REQUEST_GET;
nlhr.flags = NLHRF_HTTP11;
|