summaryrefslogtreecommitdiff
path: root/protocols/Xfire/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-06-19 19:35:42 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-06-19 19:35:42 +0000
commit4c814798c7bc7f6a0f92c21b027b26290622aa2f (patch)
tree9bbfb38bd639f352300aa16ff7c45f5a9b2dba6d /protocols/Xfire/src
parentf0f0cd088f1ec3a85abee825ddbc214f3f6b92c3 (diff)
SIZEOF replaced with more secure analog - _countof
git-svn-id: http://svn.miranda-ng.org/main/trunk@14270 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Xfire/src')
-rw-r--r--protocols/Xfire/src/Xfire_base.cpp34
-rw-r--r--protocols/Xfire/src/Xfire_game.cpp8
-rw-r--r--protocols/Xfire/src/Xfire_icon_mng.cpp2
-rw-r--r--protocols/Xfire/src/Xfire_voicechat.cpp2
-rw-r--r--protocols/Xfire/src/addgamedialog.cpp34
-rw-r--r--protocols/Xfire/src/buddylist.cpp2
-rw-r--r--protocols/Xfire/src/iniupdater.cpp16
-rw-r--r--protocols/Xfire/src/main.cpp76
-rw-r--r--protocols/Xfire/src/options.cpp30
-rw-r--r--protocols/Xfire/src/passworddialog.cpp2
-rw-r--r--protocols/Xfire/src/processbuddyinfo.cpp6
-rw-r--r--protocols/Xfire/src/pwd_dlg.cpp2
-rw-r--r--protocols/Xfire/src/searching4games.cpp22
-rw-r--r--protocols/Xfire/src/setnickname.cpp2
-rw-r--r--protocols/Xfire/src/tools.cpp4
-rw-r--r--protocols/Xfire/src/userdetails.cpp18
-rw-r--r--protocols/Xfire/src/variables.cpp4
17 files changed, 132 insertions, 132 deletions
diff --git a/protocols/Xfire/src/Xfire_base.cpp b/protocols/Xfire/src/Xfire_base.cpp
index 17a24c2e0c..eecc1b6ac7 100644
--- a/protocols/Xfire/src/Xfire_base.cpp
+++ b/protocols/Xfire/src/Xfire_base.cpp
@@ -113,7 +113,7 @@ void Xfire_base::readStringfromDB(char*name, unsigned int dbid, char**to)
return;
//wert aus der dblesen
- mir_snprintf(temp, SIZEOF(temp), "%s_%i", name, dbid);
+ mir_snprintf(temp, _countof(temp), "%s_%i", name, dbid);
if (!db_get_s(NULL, protocolname, temp, &dbv))
{
//string setzen
@@ -131,7 +131,7 @@ void Xfire_base::readStringfromDB(char*name, unsigned int dbid, int id, char**to
return;
//wert aus der dblesen
- mir_snprintf(temp, SIZEOF(temp), "%s_%i_%i", name, dbid, id);
+ mir_snprintf(temp, _countof(temp), "%s_%i_%i", name, dbid, id);
if (!db_get_s(NULL, protocolname, temp, &dbv))
{
//string setzen
@@ -149,7 +149,7 @@ void Xfire_base::readUtf8StringfromDB(char*name, unsigned int dbid, char**to)
return;
//wert aus der dblesen
- mir_snprintf(temp, SIZEOF(temp), "%s_%i", name, dbid);
+ mir_snprintf(temp, _countof(temp), "%s_%i", name, dbid);
if (!db_get_utf(NULL, protocolname, temp, &dbv))
{
//string setzen
@@ -167,7 +167,7 @@ void Xfire_base::readUtf8StringfromDB(char*name, unsigned int dbid, int id, char
return;
//wert aus der dblesen
- mir_snprintf(temp, SIZEOF(temp), "%s_%i_%i", name, dbid, id);
+ mir_snprintf(temp, _countof(temp), "%s_%i_%i", name, dbid, id);
if (!db_get_utf(NULL, protocolname, temp, &dbv))
{
//string setzen
@@ -186,7 +186,7 @@ void Xfire_base::writeStringtoDB(char*name, unsigned int dbid, int id, char*val)
return;
//wert aus der dblesen
- mir_snprintf(temp, SIZEOF(temp), "%s_%i_%i", name, dbid, id);
+ mir_snprintf(temp, _countof(temp), "%s_%i_%i", name, dbid, id);
db_set_s(NULL, protocolname, temp, val);
}
@@ -198,7 +198,7 @@ void Xfire_base::writeStringtoDB(char*name, unsigned int dbid, char*val)
return;
//wert aus der dblesen
- mir_snprintf(temp, SIZEOF(temp), "%s_%i", name, dbid);
+ mir_snprintf(temp, _countof(temp), "%s_%i", name, dbid);
db_set_s(NULL, protocolname, temp, val);
}
@@ -210,7 +210,7 @@ void Xfire_base::writeUtf8StringtoDB(char*name, unsigned int dbid, int id, char*
return;
//wert aus der dblesen
- mir_snprintf(temp, SIZEOF(temp), "%s_%i_%i", name, dbid, id);
+ mir_snprintf(temp, _countof(temp), "%s_%i_%i", name, dbid, id);
db_set_utf(NULL, protocolname, temp, val);
}
@@ -222,7 +222,7 @@ void Xfire_base::writeUtf8StringtoDB(char*name, unsigned int dbid, char*val)
return;
//wert aus der dblesen
- mir_snprintf(temp, SIZEOF(temp), "%s_%i", name, dbid);
+ mir_snprintf(temp, _countof(temp), "%s_%i", name, dbid);
db_set_utf(NULL, protocolname, temp, val);
}
@@ -235,7 +235,7 @@ void Xfire_base::writeBytetoDB(char*name, unsigned int dbid, int val)
return;
//wert aus der dblesen
- mir_snprintf(temp, SIZEOF(temp), "%s_%i", name, dbid);
+ mir_snprintf(temp, _countof(temp), "%s_%i", name, dbid);
db_set_b(NULL, protocolname, temp, val);
}
@@ -247,7 +247,7 @@ void Xfire_base::writeWordtoDB(char*name, unsigned int dbid, int val)
return;
//wert aus der dblesen
- mir_snprintf(temp, SIZEOF(temp), "%s_%i", name, dbid);
+ mir_snprintf(temp, _countof(temp), "%s_%i", name, dbid);
db_set_w(NULL, protocolname, temp, val);
}
@@ -260,7 +260,7 @@ unsigned char Xfire_base::readBytefromDB(char*name, unsigned int dbid, int defau
return 0;
//wert aus der dblesen
- mir_snprintf(temp, SIZEOF(temp), "%s_%i", name, dbid);
+ mir_snprintf(temp, _countof(temp), "%s_%i", name, dbid);
return db_get_b(NULL, protocolname, temp, defaultval);
}
@@ -272,7 +272,7 @@ unsigned int Xfire_base::readWordfromDB(char*name, unsigned int dbid, int defaul
return 0;
//wert aus der dblesen
- mir_snprintf(temp, SIZEOF(temp), "%s_%i", name, dbid);
+ mir_snprintf(temp, _countof(temp), "%s_%i", name, dbid);
return db_get_w(NULL, protocolname, temp, defaultval);
}
@@ -284,7 +284,7 @@ BOOL Xfire_base::removeDBEntry(char*name, unsigned int dbid)
return 0;
//wert aus der dblesen
- mir_snprintf(temp, SIZEOF(temp), "%s_%i", name, dbid);
+ mir_snprintf(temp, _countof(temp), "%s_%i", name, dbid);
//eintrag entfernen
if (!db_get(NULL, protocolname, temp, &dbv))
@@ -305,7 +305,7 @@ BOOL Xfire_base::removeDBEntry(char*name, unsigned int dbid, int id)
return 0;
//wert aus der dblesen
- mir_snprintf(temp, SIZEOF(temp), "%s_%i_%i", name, dbid, id);
+ mir_snprintf(temp, _countof(temp), "%s_%i_%i", name, dbid, id);
//eintrag entfernen
if (!db_get(NULL, protocolname, temp, &dbv))
@@ -479,7 +479,7 @@ BOOL Xfire_base::getIniValue(unsigned int gameid, unsigned int subid, const char
return FALSE; //kein pfad bug?!?!
if (subid == 0) {
- mir_snprintf(idstring, SIZEOF(idstring), "%d", gameid);
+ mir_snprintf(idstring, _countof(idstring), "%d", gameid);
if (xfire_GetPrivateProfileString(idstring, valname, "", out, sizeofout, path))
return TRUE;
@@ -487,7 +487,7 @@ BOOL Xfire_base::getIniValue(unsigned int gameid, unsigned int subid, const char
subid++;
}
- mir_snprintf(idstring, SIZEOF(idstring), "%d_%d", gameid, subid);
+ mir_snprintf(idstring, _countof(idstring), "%d_%d", gameid, subid);
if (xfire_GetPrivateProfileString(idstring, valname, "", out, sizeofout, path))
return TRUE;
@@ -522,7 +522,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, SIZEOF(dbstr), "customgamename_%d", gameid);
+ mir_snprintf(dbstr, _countof(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 87c0a4d2b9..02e16a955a 100644
--- a/protocols/Xfire/src/Xfire_game.cpp
+++ b/protocols/Xfire/src/Xfire_game.cpp
@@ -57,7 +57,7 @@ BOOL Xfire_game::start_game(char*ip, unsigned int port, char*pw) {
//port begrenzen
port = port % 65535;
//port in string wandeln
- mir_snprintf(portstr, SIZEOF(portstr), "%d", port);
+ mir_snprintf(portstr, _countof(portstr), "%d", port);
str_replace(mynetworkparams, "%UA_GAME_HOST_NAME%", ip);
str_replace(mynetworkparams, "%UA_GAME_HOST_PORT%", portstr);
@@ -192,11 +192,11 @@ BOOL Xfire_game::checkpath(PROCESSENTRY32* processInfo)
TCHAR fpath[MAX_PATH] = _T("");
//lese den pfad des spiels aus
- GetModuleFileNameEx(op, NULL, fpath, SIZEOF(fpath));
+ GetModuleFileNameEx(op, NULL, fpath, _countof(fpath));
//8.3 pfade umwandeln, nur wenn sich eine tilde im string befindet
if (_tcschr(fpath, '~'))
- GetLongPathName(fpath, fpath, SIZEOF(fpath));
+ GetLongPathName(fpath, fpath, _countof(fpath));
//alles in kelinbuchstaben umwandeln
this->strtolowerT(fpath);
@@ -440,7 +440,7 @@ void Xfire_game::createMenuitem(unsigned int pos, int dbid)
mi.pszPopupName = Translate("Start game");
mi.pszContactOwner = protocolname;
- mir_snprintf(temp, SIZEOF(temp), servicefunction, this->id);
+ mir_snprintf(temp, _countof(temp), servicefunction, this->id);
//wenn die servicefunktion schon exisitert vernichten, hehe
if (ServiceExists(temp))
DestroyServiceFunction(temp);
diff --git a/protocols/Xfire/src/Xfire_icon_mng.cpp b/protocols/Xfire/src/Xfire_icon_mng.cpp
index 90bf845253..d4dab1b547 100644
--- a/protocols/Xfire/src/Xfire_icon_mng.cpp
+++ b/protocols/Xfire/src/Xfire_icon_mng.cpp
@@ -137,7 +137,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, SIZEOF(resourcename), "XF_%s.ICO", shortname);
+ mir_snprintf(resourcename, _countof(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 543d75de6a..3795196aa2 100644
--- a/protocols/Xfire/src/Xfire_voicechat.cpp
+++ b/protocols/Xfire/src/Xfire_voicechat.cpp
@@ -151,7 +151,7 @@ void Xfire_voicechat::writeToDatabase(SendGameStatus2Packet* packet) {
return;
}
//ip speichern
- mir_snprintf(temp, SIZEOF(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, _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);
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 e729a80ab3..2783d38c13 100644
--- a/protocols/Xfire/src/addgamedialog.cpp
+++ b/protocols/Xfire/src/addgamedialog.cpp
@@ -144,12 +144,12 @@ static void FillGameList(LPVOID hwndDlg) {
if (z2 != zahlbuffer2)
{
listentry.gameid = MAKELONG(gameid, atoi(zahlbuffer2));
- mir_snprintf(gameidtemp, SIZEOF(gameidtemp), "%d_%d", gameid, atoi(zahlbuffer2));
+ mir_snprintf(gameidtemp, _countof(gameidtemp), "%d_%d", gameid, atoi(zahlbuffer2));
}
else
{
listentry.gameid = gameid;
- mir_snprintf(gameidtemp, SIZEOF(gameidtemp), "%d", gameid);
+ mir_snprintf(gameidtemp, _countof(gameidtemp), "%d", gameid);
}
@@ -265,7 +265,7 @@ BOOL OpenFileDialog(HWND hwndDlg, OPENFILENAMEA*ofn, char*exe) {
//kein backslash dann normal ret als exenamen verwenden
if ((int)exename == 1) exename = exe;
//filterstring aufbauen
- mir_snprintf(szFilter, SIZEOF(szFilter), "%s|%s|%s|*.*|", exename, exename, Translate("All Files"));
+ mir_snprintf(szFilter, _countof(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++)
@@ -275,7 +275,7 @@ BOOL OpenFileDialog(HWND hwndDlg, OPENFILENAMEA*ofn, char*exe) {
ofn->lStructSize = sizeof(OPENFILENAMEA);
ofn->hwndOwner = hwndDlg;
ofn->lpstrFile = szFile;
- ofn->nMaxFile = SIZEOF(szFile);
+ ofn->nMaxFile = _countof(szFile);
ofn->lpstrFilter = szFilter;
ofn->nFilterIndex = 1;
ofn->lpstrFileTitle = exe;
@@ -308,7 +308,7 @@ INT_PTR CALLBACK DlgAddGameProc(HWND hwndDlg,
{
char temp[256];
//eingabe bei der suche auslesen
- GetDlgItemTextA(hwndDlg, IDC_SEARCH, temp, SIZEOF(temp));
+ GetDlgItemTextA(hwndDlg, IDC_SEARCH, temp, _countof(temp));
//eingabe in der liste suchen
int idx = SendDlgItemMessageA(hwndDlg, IDC_GAMELIST, LB_FINDSTRING, 0, (LPARAM)temp);
//gefunden?
@@ -345,13 +345,13 @@ INT_PTR CALLBACK DlgAddGameProc(HWND hwndDlg,
int gameid2 = HIWORD(gameids);
if (gameid2 != 0)
- mir_snprintf(gameidtemp, SIZEOF(gameidtemp), "%d_%d", gameid1, gameid2);
+ mir_snprintf(gameidtemp, _countof(gameidtemp), "%d_%d", gameid1, gameid2);
else
- mir_snprintf(gameidtemp, SIZEOF(gameidtemp), "%d", gameid1);
+ mir_snprintf(gameidtemp, _countof(gameidtemp), "%d", gameid1);
//spielnamen holen
if (xfire_GetPrivateProfileString(gameidtemp, "LongName", "", ret, 512, inipath)) {
- mir_snprintf(gameidtemp, SIZEOF(gameidtemp), "%d", gameid1);
+ mir_snprintf(gameidtemp, _countof(gameidtemp), "%d", gameid1);
//einige felder vorbelegen
SetDlgItemTextA(hPage, IDC_ADD_NAME, ret);
@@ -389,9 +389,9 @@ INT_PTR CALLBACK DlgAddGameProc(HWND hwndDlg,
char ret[512];
if (gameid2 != 0)
- mir_snprintf(gameidtemp, SIZEOF(gameidtemp), "%d_%d", gameid1, gameid2);
+ mir_snprintf(gameidtemp, _countof(gameidtemp), "%d_%d", gameid1, gameid2);
else
- mir_snprintf(gameidtemp, SIZEOF(gameidtemp), "%d", gameid1);
+ mir_snprintf(gameidtemp, _countof(gameidtemp), "%d", gameid1);
//neuen gameeintrag anlegen
Xfire_game* newgame = new Xfire_game();
@@ -628,7 +628,7 @@ INT_PTR CALLBACK DlgAddGameProc2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
newgame = new Xfire_game();
//Spielname
- GetDlgItemTextA(hwndDlg, IDC_ADD_NAME, temp, SIZEOF(temp));
+ GetDlgItemTextA(hwndDlg, IDC_ADD_NAME, temp, _countof(temp));
if (!mir_strlen(temp))
{
if (!editgame) delete newgame;
@@ -643,7 +643,7 @@ INT_PTR CALLBACK DlgAddGameProc2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
}
//spielid nur setzen/prüfen, wenn kein editgame
if (!editgame) {
- GetDlgItemTextA(hwndDlg, IDC_ADD_ID, temp, SIZEOF(temp));
+ GetDlgItemTextA(hwndDlg, IDC_ADD_ID, temp, _countof(temp));
if (!mir_strlen(temp))
{
if (!editgame) delete newgame;
@@ -671,7 +671,7 @@ INT_PTR CALLBACK DlgAddGameProc2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
}
}
//zu sendene spielid
- GetDlgItemTextA(hwndDlg, IDC_ADD_SENDID, temp, SIZEOF(temp));
+ GetDlgItemTextA(hwndDlg, IDC_ADD_SENDID, temp, _countof(temp));
if (mir_strlen(temp))
{
//standardmäßig wird bei einem customeintrag keine id versendet
@@ -681,7 +681,7 @@ INT_PTR CALLBACK DlgAddGameProc2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
}
//launcher exe
- GetDlgItemTextA(hwndDlg, IDC_ADD_LAUNCHEREXE, temp, SIZEOF(temp));
+ GetDlgItemTextA(hwndDlg, IDC_ADD_LAUNCHEREXE, temp, _countof(temp));
if (mir_strlen(temp))
{
//lowercase pfad
@@ -690,7 +690,7 @@ INT_PTR CALLBACK DlgAddGameProc2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
newgame->setString(temp, &newgame->launchparams);
}
//detectexe
- GetDlgItemTextA(hwndDlg, IDC_ADD_DETECTEXE, temp, SIZEOF(temp));
+ GetDlgItemTextA(hwndDlg, IDC_ADD_DETECTEXE, temp, _countof(temp));
if (!mir_strlen(temp))
{
if (!editgame) delete newgame;
@@ -708,13 +708,13 @@ INT_PTR CALLBACK DlgAddGameProc2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
}
//mustcontain parameter
- GetDlgItemTextA(hwndDlg, IDC_ADD_CUSTOMPARAMS, temp, SIZEOF(temp));
+ GetDlgItemTextA(hwndDlg, IDC_ADD_CUSTOMPARAMS, temp, _countof(temp));
if (mir_strlen(temp))
{
newgame->setString(temp, &newgame->mustcontain);
}
//statusmsg speichern
- GetDlgItemTextA(hwndDlg, IDC_ADD_STATUSMSG, temp, SIZEOF(temp));
+ GetDlgItemTextA(hwndDlg, IDC_ADD_STATUSMSG, temp, _countof(temp));
if (mir_strlen(temp))
{
newgame->setString(temp, &newgame->statusmsg);
diff --git a/protocols/Xfire/src/buddylist.cpp b/protocols/Xfire/src/buddylist.cpp
index ac3bfbf608..e3a5dd7dff 100644
--- a/protocols/Xfire/src/buddylist.cpp
+++ b/protocols/Xfire/src/buddylist.cpp
@@ -146,7 +146,7 @@ namespace xfirelib {
/* ## buddies im miranda verarbietn */
char temp[255];
char * dummy;
- mir_snprintf(temp,SIZEOF(temp),"Clan_%d",entry->clanid);
+ mir_snprintf(temp,_countof(temp),"Clan_%d",entry->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 072e0f692e..6d97588ad4 100644
--- a/protocols/Xfire/src/iniupdater.cpp
+++ b/protocols/Xfire/src/iniupdater.cpp
@@ -53,11 +53,11 @@ void UpdateMyXFireIni(LPVOID dummy) {
//ini pfad rausbekommen
char file[1024], file2[1024], file3[1024];
- mir_snprintf(file,SIZEOF(file), "%sxfire_games.new",inipath);
- mir_snprintf(file2,SIZEOF(file2), "%sxfire_games.ini",inipath);
- mir_snprintf(file3,SIZEOF(file3), "%sxfire_games.old",inipath);
+ 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(request, SIZEOF(request), "%s%d", INI_URLREQUEST, getfilesize(file2));
+ mir_snprintf(request, _countof(request), "%s%d", INI_URLREQUEST, getfilesize(file2));
if (CheckWWWContent(request))
{
@@ -89,11 +89,11 @@ void UpdateMyIcons(LPVOID dummy) {
//ini pfad rausbekommen
char file[1024], file2[1024], file3[1024];
- mir_snprintf(file,SIZEOF(file), "%sicons.new",inipath);
- mir_snprintf(file2,SIZEOF(file2), "%sicons.dll",inipath);
- mir_snprintf(file3,SIZEOF(file3), "%sicons.old",inipath);
+ 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(request, SIZEOF(request), "%s%d", ICO_URLREQUEST, getfilesize(file2));
+ mir_snprintf(request, _countof(request), "%s%d", ICO_URLREQUEST, getfilesize(file2));
if (CheckWWWContent(request))
{
diff --git a/protocols/Xfire/src/main.cpp b/protocols/Xfire/src/main.cpp
index fd04b1f76e..968e3e6664 100644
--- a/protocols/Xfire/src/main.cpp
+++ b/protocols/Xfire/src/main.cpp
@@ -419,7 +419,7 @@ void XFireClient::receivedPacket(XFirePacket *packet) {
for (int i = 0; i < claninv->numberOfInv; i++)
{
char msg[XFIRE_MAX_STATIC_STRING_LEN];
- mir_snprintf(msg, SIZEOF(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, _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(),
claninv->invitefrom[i].c_str(),
claninv->clanname[i].c_str(),
claninv->invitemsg[i].c_str(), "\n");
@@ -482,7 +482,7 @@ void XFireClient::receivedPacket(XFirePacket *packet) {
char temp[255];
char * dummy;
ClanBuddyListNamesPacket *clan = (ClanBuddyListNamesPacket*)content;
- mir_snprintf(temp, SIZEOF(temp), "Clan_%d", clan->clanid);
+ mir_snprintf(temp, _countof(temp), "Clan_%d", clan->clanid);
DBVARIANT dbv;
if (!db_get(NULL,protocolname,temp,&dbv))
@@ -638,10 +638,10 @@ void XFireClient::receivedPacket(XFirePacket *packet) {
for (int i = 0; i < clan->count; i++)
{
- mir_snprintf(temp, SIZEOF(temp), "Clan_%d", clan->clanid[i]);
+ mir_snprintf(temp, _countof(temp), "Clan_%d", clan->clanid[i]);
db_set_s(NULL, protocolname, temp, (char*)clan->name[i].c_str());
- mir_snprintf(temp, SIZEOF(temp), "ClanUrl_%d", clan->clanid[i]);
+ mir_snprintf(temp, _countof(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)) {
@@ -681,7 +681,7 @@ void XFireClient::receivedPacket(XFirePacket *packet) {
//recprotoverchg
if (db_get_w(NULL, protocolname, "recprotoverchg", 0) == 0)
{
- mir_snprintf(temp, SIZEOF(temp), Translate("The protocol version is too old. Changed current version from %d to %d. You can reconnect now."), client->protocolVersion, version->newversion);
+ mir_snprintf(temp, _countof(temp), Translate("The protocol version is too old. Changed current version from %d to %d. You can reconnect now."), client->protocolVersion, version->newversion);
MSGBOXE(temp);
}
else
@@ -692,7 +692,7 @@ void XFireClient::receivedPacket(XFirePacket *packet) {
}
else
{
- mir_snprintf(temp, SIZEOF(temp), Translate("The protocol version is too old. Cannot detect a new version number."));
+ mir_snprintf(temp, _countof(temp), Translate("The protocol version is too old. Cannot detect a new version number."));
MSGBOXE(temp);
SetStatus(ID_STATUS_OFFLINE, NULL);
}
@@ -847,7 +847,7 @@ INT_PTR UrlCall(WPARAM wparam, LPARAM lparam) {
if (mir_strlen(g) > 25) //zugroße abschneiden
*(g + 25) = 0;
- mir_snprintf(temp, SIZEOF(temp), Translate("Do you really want to add %s to your friend list?"), g);
+ mir_snprintf(temp, _countof(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)
{
@@ -1045,7 +1045,7 @@ extern "C" __declspec(dllexport) int Load(void)
//statusmessages setzen
mir_strcpy(statusmessage[0], "");
- mir_snprintf(statusmessage[1], SIZEOF(statusmessage[1]), "(AFK) %s", Translate("Away from Keyboard"));
+ mir_snprintf(statusmessage[1], _countof(statusmessage[1]), "(AFK) %s", Translate("Away from Keyboard"));
HookEvent(ME_OPT_INITIALISE, OptInit);
HookEvent(ME_SYSTEM_MODULESLOADED, OnSystemModulesLoaded);
@@ -1525,7 +1525,7 @@ INT_PTR SetStatus(WPARAM wParam, LPARAM lParam)
{
//setze bei aktivem nocustomaway die alte awaystatusmsg zurück, bugfix
if (db_get_b(NULL, protocolname, "nocustomaway", 0))
- mir_snprintf(statusmessage[1], SIZEOF(statusmessage[1]), "(AFK) %s", Translate("Away from Keyboard"));
+ mir_snprintf(statusmessage[1], _countof(statusmessage[1]), "(AFK) %s", Translate("Away from Keyboard"));
myClient->Status(statusmessage[1]);
}
@@ -1914,7 +1914,7 @@ static INT_PTR GetIPPort(WPARAM hContact, LPARAM lParam)
return 0;
char temp[XFIRE_MAX_STATIC_STRING_LEN];
- mir_snprintf(temp, SIZEOF(temp), "%s:%d", dbv.pszVal, db_get_w(hContact, protocolname, "Port", -1));
+ mir_snprintf(temp, _countof(temp), "%s:%d", dbv.pszVal, db_get_w(hContact, protocolname, "Port", -1));
db_free(&dbv);
if (OpenClipboard(NULL)) {
@@ -1942,7 +1942,7 @@ static INT_PTR GetVIPPort(WPARAM hContact, LPARAM lParam)
return 0;
char temp[XFIRE_MAX_STATIC_STRING_LEN];
- mir_snprintf(temp, SIZEOF(temp), "%s:%d", dbv.pszVal, db_get_w(hContact, protocolname, "VPort", -1));
+ mir_snprintf(temp, _countof(temp), "%s:%d", dbv.pszVal, db_get_w(hContact, protocolname, "VPort", -1));
db_free(&dbv);
if (OpenClipboard(NULL)) {
@@ -1982,7 +1982,7 @@ static INT_PTR GotoXFireClanSite(WPARAM hContact, LPARAM lParam)
char temp[64] = "";
int clanid = db_get_dw(hContact, protocolname, "Clan", -1);
- mir_snprintf(temp, SIZEOF(temp), "ClanUrl_%d", clanid);
+ mir_snprintf(temp, _countof(temp), "ClanUrl_%d", clanid);
if (db_get_s(NULL, protocolname, temp, &dbv))
return 0;
@@ -2210,7 +2210,7 @@ void gamedetectiont(LPVOID lparam)
if (packet->ip[3]!=0)
{
- mir_snprintf(temp, SIZEOF(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, _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);
db_set_s(NULL, protocolname, "VServerIP", temp);
db_set_s(NULL, protocolname, "currentvoicename", "Teamspeak");
}
@@ -2250,7 +2250,7 @@ void gamedetectiont(LPVOID lparam)
db_set_w(NULL,protocolname,"currentvoice",vid);
- mir_snprintf(temp, SIZEOF(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, _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);
db_set_s(NULL, protocolname, "VServerIP", temp);
if (myClient!=NULL)
@@ -2290,7 +2290,7 @@ void gamedetectiont(LPVOID lparam)
packet->gameid=vid;
db_set_w(NULL,protocolname,"currentvoice",vid);
- mir_snprintf(temp, SIZEOF(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, _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);
db_set_s(NULL, protocolname, "VServerIP", temp);
if (myClient!=NULL)
@@ -2345,7 +2345,7 @@ void gamedetectiont(LPVOID lparam)
myClient->Status(statusmessage[1]);
}
- mir_snprintf(temp, SIZEOF(temp), Translate("Last game: %s playtime: %.2d:%.2d:%.2d"), currentgame->name, mytm->tm_hour, mytm->tm_min, mytm->tm_sec);
+ mir_snprintf(temp, _countof(temp), Translate("Last game: %s playtime: %.2d:%.2d:%.2d"), currentgame->name, mytm->tm_hour, mytm->tm_min, mytm->tm_sec);
db_set_s(NULL, protocolname, "LastGame", temp);
if (currentgame->noicqstatus != TRUE&&db_get_b(NULL, protocolname, "autosetstatusmsg", 0))
@@ -2399,7 +2399,7 @@ void gamedetectiont(LPVOID lparam)
if (packet->ip[3] != 0)
{
- mir_snprintf(temp, SIZEOF(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, _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);
db_set_s(NULL, protocolname, "ServerIP", temp);
XFireLog("Got IPPort: %s", temp);
}
@@ -2714,7 +2714,7 @@ MCONTACT handlingBuddys(BuddyListEntry *entry, int clan, char*group, BOOL dontsc
{
if ((unsigned char)gameob->ip[3] != 0) // wenn ip, dann speichern
{
- mir_snprintf(temp, SIZEOF(temp), "%d.%d.%d.%d", (unsigned char)gameob->ip[3], (unsigned char)gameob->ip[2], (unsigned char)gameob->ip[1], (unsigned char)gameob->ip[0]);
+ mir_snprintf(temp, _countof(temp), "%d.%d.%d.%d", (unsigned char)gameob->ip[3], (unsigned char)gameob->ip[2], (unsigned char)gameob->ip[1], (unsigned char)gameob->ip[0]);
db_set_s(hContact, protocolname, "VServerIP", temp);
db_set_w(hContact, protocolname, "VPort", (unsigned long)gameob->port);
}
@@ -2754,7 +2754,7 @@ MCONTACT handlingBuddys(BuddyListEntry *entry, int clan, char*group, BOOL dontsc
if (db_get_b(NULL, protocolname, "gamepopup", 0) == 1) {
char temp[256] = "";
- mir_snprintf(temp, SIZEOF(temp), Translate("%s is playing %s."),
+ mir_snprintf(temp, _countof(temp), Translate("%s is playing %s."),
//ist ein nick gesetzt?
(entry->nick.length() == 0 ?
//nein dann username
@@ -2767,7 +2767,7 @@ MCONTACT handlingBuddys(BuddyListEntry *entry, int clan, char*group, BOOL dontsc
{
if ((unsigned char)gameob->ip[3] != 0)
{
- mir_snprintf(temp, SIZEOF(temp), Translate("%s is playing %s on server %d.%d.%d.%d:%d."),
+ mir_snprintf(temp, _countof(temp), Translate("%s is playing %s on server %d.%d.%d.%d:%d."),
//ist ein nick gesetzt?
(entry->nick.length() == 0 ?
//nein dann username
@@ -2817,7 +2817,7 @@ MCONTACT handlingBuddys(BuddyListEntry *entry, int clan, char*group, BOOL dontsc
if ((unsigned char)gameob->ip[3] != 0)
{
//ip und port in kontakt speichern
- mir_snprintf(temp, SIZEOF(temp), "%d.%d.%d.%d", (unsigned char)gameob->ip[3], (unsigned char)gameob->ip[2], (unsigned char)gameob->ip[1], (unsigned char)gameob->ip[0]);
+ mir_snprintf(temp, _countof(temp), "%d.%d.%d.%d", (unsigned char)gameob->ip[3], (unsigned char)gameob->ip[2], (unsigned char)gameob->ip[1], (unsigned char)gameob->ip[0]);
db_set_s(hContact, protocolname, "ServerIP", temp);
db_set_w(hContact, protocolname, "Port", (unsigned long)gameob->port);
@@ -2828,7 +2828,7 @@ MCONTACT handlingBuddys(BuddyListEntry *entry, int clan, char*group, BOOL dontsc
GameServerQuery_query gsqq = { 0 };
gsqq.port = gameob->port;
gsqq.xfiregameid = entry->game;
- strncpy(gsqq.ip, temp, SIZEOF(gsqq.ip)-1);
+ strncpy(gsqq.ip, temp, _countof(gsqq.ip)-1);
CallService("GameServerQuery/Query", (WPARAM)entry, (LPARAM)&gsqq);
}
}
@@ -2941,11 +2941,11 @@ MCONTACT handlingBuddys(BuddyListEntry *entry, int clan, char*group, BOOL dontsc
{
char temp[256];
DBVARIANT dbv;
- mir_snprintf(temp, SIZEOF(temp), "%d", val - 1);
+ mir_snprintf(temp, _countof(temp), "%d", val - 1);
db_get_s(NULL, "CListGroups", temp, &dbv);
if (dbv.pszVal != NULL)
{
- mir_snprintf(temp, SIZEOF(temp), "%s\\%s", &dbv.pszVal[1], group);
+ mir_snprintf(temp, _countof(temp), "%s\\%s", &dbv.pszVal[1], group);
db_set_s(entry->hcontact, "CList", "Group", temp);
db_free(&dbv);
}
@@ -2964,11 +2964,11 @@ MCONTACT handlingBuddys(BuddyListEntry *entry, int clan, char*group, BOOL dontsc
{
char temp[256];
DBVARIANT dbv;
- mir_snprintf(temp, SIZEOF(temp), "%d", val - 1);
+ mir_snprintf(temp, _countof(temp), "%d", val - 1);
db_get_s(NULL, "CListGroups", temp, &dbv);
if (dbv.pszVal != NULL)
{
- mir_snprintf(temp, SIZEOF(temp), "%s\\%s", &dbv.pszVal[1], group);
+ mir_snprintf(temp, _countof(temp), "%s\\%s", &dbv.pszVal[1], group);
db_set_s(entry->hcontact, "CList", "Group", temp);
db_free(&dbv);
}
@@ -3068,21 +3068,21 @@ void CreateGroup(char*grpn, char*field) {
if (val == 0)
{
- strcpy_s(grp, SIZEOF(grp), grpn);//((char*)clan->name[i].c_str());
+ strcpy_s(grp, _countof(grp), grpn);//((char*)clan->name[i].c_str());
}
else
{
char temp[255];
DBVARIANT dbv;
- mir_snprintf(temp, SIZEOF(temp), "%d", val - 1);
+ mir_snprintf(temp, _countof(temp), "%d", val - 1);
if (!db_get_s(NULL, "CListGroups", temp, &dbv))
{
- mir_snprintf(grp, SIZEOF(grp), "%s\\%s", &dbv.pszVal[1], grpn);
+ mir_snprintf(grp, _countof(grp), "%s\\%s", &dbv.pszVal[1], grpn);
db_free(&dbv);
}
else //gruppe existiert nciht mehr, auf root alles legen
{
- strcpy_s(grp, SIZEOF(grp), grpn);
+ strcpy_s(grp, _countof(grp), grpn);
db_set_b(NULL, protocolname, field, 0);
}
}
@@ -3093,7 +3093,7 @@ void CreateGroup(char*grpn, char*field) {
int i = 0;
for (i = 0;; i++)
{
- mir_snprintf(temp, SIZEOF(temp), "%d", i);
+ mir_snprintf(temp, _countof(temp), "%d", i);
if (db_get_s(NULL, "CListGroups", temp, &dbv))
{
i--;
@@ -3108,7 +3108,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, SIZEOF(temp), "%d", i + 1);
+ mir_snprintf(temp, _countof(temp), "%d", i + 1);
db_set_s(NULL, "CListGroups", temp, group);
CallServiceSync(MS_CLUI_GROUPADDED, i + 1, 0);
}
@@ -3125,7 +3125,7 @@ INT_PTR SetAwayMsg(WPARAM wParam, LPARAM lParam)
}
else if (wParam != ID_STATUS_OFFLINE/*&&db_get_b(NULL,protocolname,"nocustomaway",0)==0*/)
{
- mir_snprintf(statusmessage[1], SIZEOF(statusmessage[1]), "(AFK) %s", Translate("Away from Keyboard"));
+ mir_snprintf(statusmessage[1], _countof(statusmessage[1]), "(AFK) %s", Translate("Away from Keyboard"));
}
}
else
@@ -3136,11 +3136,11 @@ INT_PTR SetAwayMsg(WPARAM wParam, LPARAM 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], SIZEOF(statusmessage[1]), "(AFK) %s", (char*)lParam);
+ mir_snprintf(statusmessage[1], _countof(statusmessage[1]), "(AFK) %s", (char*)lParam);
//mir_strcpy(statusmessage[1],( char* )lParam);
}
else
- mir_snprintf(statusmessage[1], SIZEOF(statusmessage[1]), "(AFK) %s", Translate("Away from Keyboard"));
+ mir_snprintf(statusmessage[1], _countof(statusmessage[1]), "(AFK) %s", Translate("Away from Keyboard"));
}
}
@@ -3239,7 +3239,7 @@ INT_PTR RemoveFriend(WPARAM hContact, LPARAM lParam)
if (!db_get_s(hContact, protocolname, "Username", &dbv))
{
- mir_snprintf(temp, SIZEOF(temp), Translate("Do you really want to delete your friend %s?"), dbv.pszVal);
+ mir_snprintf(temp, _countof(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)
@@ -3342,7 +3342,7 @@ int doneQuery(WPARAM wParam, LPARAM lParam) {
db_set_s(bud->hcontact, protocolname, "ServerName", gameinfo->name);
db_set_s(bud->hcontact, protocolname, "GameType", gameinfo->gametype);
db_set_s(bud->hcontact, protocolname, "Map", gameinfo->map);
- mir_snprintf(temp, SIZEOF(temp), "(%d/%d)", gameinfo->players, gameinfo->maxplayers);
+ mir_snprintf(temp, _countof(temp), "(%d/%d)", gameinfo->players, gameinfo->maxplayers);
db_set_s(bud->hcontact, protocolname, "Players", temp);
db_set_b(bud->hcontact, protocolname, "Passworded", gameinfo->password);
@@ -3367,7 +3367,7 @@ int IconLibChanged(WPARAM wParam, LPARAM lParam) {
//ImageList_ReplaceIcon(hAdvancedStatusIcon,(int)icocache[i].handle,icocache[i].hicon);
HANDLE before=icocache[i].handle;
icocache[i].handle=(HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)icocache[i].hicon, 0);
- mir_snprintf(temp, SIZEOF(temp), "before: %d after: %d", before, icocache[i].handle);
+ mir_snprintf(temp, _countof(temp), "before: %d after: %d", before, icocache[i].handle);
MessageBoxA(NULL,temp,temp,0);
DrawIcon(GetDC(NULL),x,0,(HICON)CallService(MS_SKIN2_GETICONBYHANDLE,0,(LPARAM)icocache[i].handle));
x+=32;
diff --git a/protocols/Xfire/src/options.cpp b/protocols/Xfire/src/options.cpp
index fd13a4688c..670564ea8f 100644
--- a/protocols/Xfire/src/options.cpp
+++ b/protocols/Xfire/src/options.cpp
@@ -181,7 +181,7 @@ static INT_PTR CALLBACK DlgProcOpts2(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
}
char temp[255] = "";
- mir_snprintf(temp, SIZEOF(temp), "%d", db_get_b(NULL, protocolname, "protover", 0x5b));
+ mir_snprintf(temp, _countof(temp), "%d", db_get_b(NULL, protocolname, "protover", 0x5b));
SetDlgItemTextA(hwndDlg, IDC_PVER, temp);
EnableWindow(GetDlgItem(hwndDlg, IDC_LASTGAME), FALSE);
@@ -253,7 +253,7 @@ static INT_PTR CALLBACK DlgProcOpts2(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
char str[128];
DBVARIANT dbv;
- GetDlgItemTextA(hwndDlg, IDC_LOGIN, login, SIZEOF(login));
+ GetDlgItemTextA(hwndDlg, IDC_LOGIN, login, _countof(login));
dbv.pszVal = NULL;
if (db_get(NULL, protocolname, "login", &dbv) || mir_strcmp(login, dbv.pszVal))
reconnectRequired = 1;
@@ -278,7 +278,7 @@ static INT_PTR CALLBACK DlgProcOpts2(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
db_set_s(NULL, protocolname, "Username", login);
//nur wenn der nick erfolgreich übertragen wurde
- GetDlgItemTextA(hwndDlg, IDC_NICK, login, SIZEOF(login));
+ GetDlgItemTextA(hwndDlg, IDC_NICK, login, _countof(login));
dbv.pszVal = NULL;
if (db_get(NULL, protocolname, "Nick", &dbv) || mir_strcmp(login, dbv.pszVal))
{
@@ -288,14 +288,14 @@ static INT_PTR CALLBACK DlgProcOpts2(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
if (dbv.pszVal != NULL)
db_free(&dbv);
- GetDlgItemTextA(hwndDlg, IDC_PASSWORD, str, SIZEOF(str));
+ GetDlgItemTextA(hwndDlg, IDC_PASSWORD, str, _countof(str));
dbv.pszVal = NULL;
if (db_get(NULL, protocolname, "password", &dbv) || mir_strcmp(str, dbv.pszVal))
reconnectRequired = 1;
if (dbv.pszVal != NULL)
db_free(&dbv);
db_set_s(NULL, protocolname, "password", str);
- GetDlgItemTextA(hwndDlg, IDC_SERVER, str, SIZEOF(str));
+ GetDlgItemTextA(hwndDlg, IDC_SERVER, str, _countof(str));
//neue preferencen sichern
if (bpStatus != ID_STATUS_OFFLINE&&bpStatus != ID_STATUS_CONNECTING)
@@ -322,7 +322,7 @@ static INT_PTR CALLBACK DlgProcOpts2(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
}
//protocolversion wird autoamtisch vergeben
- //GetDlgItemTextA(hwndDlg,IDC_PVER,str,SIZEOF(str));
+ //GetDlgItemTextA(hwndDlg,IDC_PVER,str,_countof(str));
//db_set_b(NULL,protocolname,"protover",(char)atoi(str));
if (reconnectRequired)
@@ -379,11 +379,11 @@ 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, SIZEOF(temp), "%d", gruppen_id);
+ mir_snprintf(temp, _countof(temp), "%d", gruppen_id);
while (!db_get_s(NULL, "CListGroups", temp, &dbv))
{
gruppen_id++;
- mir_snprintf(temp, SIZEOF(temp), "%d", gruppen_id);
+ mir_snprintf(temp, _countof(temp), "%d", gruppen_id);
if (dbv.pszVal != NULL) {
SendDlgItemMessageA(hwndDlg, IDC_CLANGROUP, CB_ADDSTRING, 0, (LPARAM)&dbv.pszVal[1]);
@@ -724,7 +724,7 @@ static INT_PTR CALLBACK DlgProcOpts5(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
int reconnectRequired = 0;
char str[512];
- GetDlgItemTextA(hwndDlg, IDC_STATUSMSG, str, SIZEOF(str));
+ GetDlgItemTextA(hwndDlg, IDC_STATUSMSG, str, _countof(str));
db_set_s(NULL, protocolname, "setstatusmsg", str);
db_set_b(NULL, protocolname, "autosetstatusmsg", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ENABLESTSMSG));
@@ -776,7 +776,7 @@ static INT_PTR CALLBACK DlgProcOpts6(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
for (int i = 0; i < found; i++)
{
//id auslesen
- mir_snprintf(temp, SIZEOF(temp), "gameid_%d", i);
+ mir_snprintf(temp, _countof(temp), "gameid_%d", i);
int gameid = db_get_w(NULL, protocolname, temp, 0);
//spielnamen auslesen
xgamelist.getGamename(gameid, temp, XFIRE_MAXSIZEOFGAMENAME);
@@ -983,18 +983,18 @@ static INT_PTR CALLBACK DlgProcOpts6(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
//gameskip wert setzen
char temp[64] = "";
- mir_snprintf(temp, SIZEOF(temp), "gameskip_%d", gameid);
+ mir_snprintf(temp, _countof(temp), "gameskip_%d", gameid);
CheckDlgButton(hwndDlg, IDC_DONTDETECT, db_get_b(NULL, protocolname, temp, 0) ? BST_CHECKED : BST_UNCHECKED);
- mir_snprintf(temp, SIZEOF(temp), "gamenostatus_%d", gameid);
+ mir_snprintf(temp, _countof(temp), "gamenostatus_%d", gameid);
CheckDlgButton(hwndDlg, IDC_NOSTATUSMSG, db_get_b(NULL, protocolname, temp, 0) ? BST_CHECKED : BST_UNCHECKED);
- mir_snprintf(temp, SIZEOF(temp), "notinstartmenu_%d", gameid);
+ mir_snprintf(temp, _countof(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, SIZEOF(temp), "gameextraparams_%d", gameid);
+ mir_snprintf(temp, _countof(temp), "gameextraparams_%d", gameid);
DBVARIANT dbv;
if (!db_get(NULL, protocolname, temp, &dbv))
{
@@ -1035,7 +1035,7 @@ static INT_PTR CALLBACK DlgProcOpts6(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
//extra parameter auslesen und das gameobj schreiben
char str[128] = "";
- GetDlgItemTextA(hwndDlg, IDC_EXTRAPARAMS, str, SIZEOF(str));
+ GetDlgItemTextA(hwndDlg, IDC_EXTRAPARAMS, str, _countof(str));
if (str[0] != 0)
{
//extra parameter sind gesetzt, zuweisen
diff --git a/protocols/Xfire/src/passworddialog.cpp b/protocols/Xfire/src/passworddialog.cpp
index 4be5760eef..fac061f214 100644
--- a/protocols/Xfire/src/passworddialog.cpp
+++ b/protocols/Xfire/src/passworddialog.cpp
@@ -15,7 +15,7 @@ INT_PTR CALLBACK DlgPWProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
GetDlgItemTextA(hwndDlg, IDC_PWSTRING, (LPSTR)pw, 254);
if (usenick)
- GetDlgItemTextA(hwndDlg, IDC_PWNICK, (LPSTR)nick, SIZEOF(nick));
+ GetDlgItemTextA(hwndDlg, IDC_PWNICK, (LPSTR)nick, _countof(nick));
EndDialog(hwndDlg, (INT_PTR)pw);
break;
}
diff --git a/protocols/Xfire/src/processbuddyinfo.cpp b/protocols/Xfire/src/processbuddyinfo.cpp
index 26b9697d71..788991c7db 100644
--- a/protocols/Xfire/src/processbuddyinfo.cpp
+++ b/protocols/Xfire/src/processbuddyinfo.cpp
@@ -58,7 +58,7 @@ void ProcessBuddyInfo(xfirelib::BuddyInfoPacket *buddyinfo, MCONTACT hcontact, c
mir_strcat(filename, ".gif");
type = PA_FORMAT_GIF;
- mir_snprintf(temp, SIZEOF(temp), "/xfire/xf/images/avatars/gallery/default/%03d.gif", buddyinfo->avatarid);
+ mir_snprintf(temp, _countof(temp), "/xfire/xf/images/avatars/gallery/default/%03d.gif", buddyinfo->avatarid);
dl = GetWWWContent("media.xfire.com", temp, filename, FALSE);
break;
@@ -67,7 +67,7 @@ void ProcessBuddyInfo(xfirelib::BuddyInfoPacket *buddyinfo, MCONTACT hcontact, c
mir_strcat(filename, ".jpg");
type = PA_FORMAT_JPEG;
- mir_snprintf(temp, SIZEOF(temp), "/avatar/100/%s.jpg?%d", username, buddyinfo->avatarid);
+ mir_snprintf(temp, _countof(temp), "/avatar/100/%s.jpg?%d", username, buddyinfo->avatarid);
dl = GetWWWContent("screenshot.xfire.com", temp, filename, FALSE);
break;
@@ -75,7 +75,7 @@ void ProcessBuddyInfo(xfirelib::BuddyInfoPacket *buddyinfo, MCONTACT hcontact, c
type = PA_FORMAT_GIF;
mir_strcat(filename, "xfire.gif");
- mir_snprintf(temp, SIZEOF(temp), "/xfire/xf/images/avatars/gallery/default/xfire.gif", buddyinfo->avatarid);
+ mir_snprintf(temp, _countof(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/pwd_dlg.cpp b/protocols/Xfire/src/pwd_dlg.cpp
index 31108404a8..3703e6caa1 100644
--- a/protocols/Xfire/src/pwd_dlg.cpp
+++ b/protocols/Xfire/src/pwd_dlg.cpp
@@ -20,7 +20,7 @@ INT_PTR CALLBACK DlgPwProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
if (LOWORD(wParam) == IDOK)
{
- GetDlgItemTextA(hwndDlg, IDC_NICKNAME, password, SIZEOF(password));
+ GetDlgItemTextA(hwndDlg, IDC_NICKNAME, password, _countof(password));
EndDialog(hwndDlg, TRUE);
return TRUE;
}
diff --git a/protocols/Xfire/src/searching4games.cpp b/protocols/Xfire/src/searching4games.cpp
index 01fb52f082..0be853b828 100644
--- a/protocols/Xfire/src/searching4games.cpp
+++ b/protocols/Xfire/src/searching4games.cpp
@@ -69,9 +69,9 @@ BOOL CheckPath(char*ppath, char*pathwildcard = NULL)
strncpy(temp, ppath,XFIRE_MAX_STATIC_STRING_LEN-1);
*(temp + mir_strlen(temp) - 1) = 0;
- mir_strncat(temp, wfd.cFileName, SIZEOF(temp) - mir_strlen(temp));
- mir_strncat(temp, "\\", SIZEOF(temp) - mir_strlen(temp));
- mir_strncat(temp, pos, SIZEOF(temp) - mir_strlen(temp));
+ mir_strncat(temp, wfd.cFileName, _countof(temp) - mir_strlen(temp));
+ mir_strncat(temp, "\\", _countof(temp) - mir_strlen(temp));
+ mir_strncat(temp, pos, _countof(temp) - mir_strlen(temp));
if (GetFileAttributesA(temp) != 0xFFFFFFFF) { //exe vorhanden???? unt hint?
//gefundenes in path kopieren
@@ -253,9 +253,9 @@ void Scan4Games(LPVOID lparam)
{
//2 gameids?
if (split)
- mir_snprintf(temp, SIZEOF(temp), "%i_%i", i, i2);
+ mir_snprintf(temp, _countof(temp), "%i_%i", i, i2);
else
- mir_snprintf(temp, SIZEOF(temp), "%i", i);
+ mir_snprintf(temp, _countof(temp), "%i", i);
//MessageBox(0,temp,temp,0);
@@ -467,7 +467,7 @@ void Scan4Games(LPVOID lparam)
multiexe = FALSE;
for (int i = 1; i < 9; i++)
{
- mir_snprintf(ret, SIZEOF(ret), "DetectExe[%d]", i);
+ mir_snprintf(ret, _countof(ret), "DetectExe[%d]", i);
if (xfire_GetPrivateProfileString(temp, ret, "", ret2, 512, inipath))
{
char* pos = strrchr(path, '\\');
@@ -550,7 +550,7 @@ void Scan4Games(LPVOID lparam)
newgame->setString(ret2, &newgame->launchparams);
//soll alle string, welche nicht in der commandline eines spiels sein soll in einen string pakcen semikolon getrennt
- mir_snprintf(ret, SIZEOF(ret), "CommandLineMustNotContain[0]");
+ mir_snprintf(ret, _countof(ret), "CommandLineMustNotContain[0]");
int i = 0;
while (xfire_GetPrivateProfileString(temp, ret, "", ret2, 512, inipath))
@@ -561,7 +561,7 @@ void Scan4Games(LPVOID lparam)
newgame->appendString(ret2, &newgame->notcontain);
i++;
- mir_snprintf(ret, SIZEOF(ret), "CommandLineMustNotContain[%d]", i);
+ mir_snprintf(ret, _countof(ret), "CommandLineMustNotContain[%d]", i);
}
newgame->setNameandIcon();
@@ -652,7 +652,7 @@ void Scan4Games(LPVOID lparam)
newgame->setstatusmsg = atoi(ret2);
//soll alle string, welche nicht in der commandline eines spiels sein soll in einen string pakcen semikolon getrennt
- mir_snprintf(ret, SIZEOF(ret), "CommandLineMustNotContain[0]");
+ mir_snprintf(ret, _countof(ret), "CommandLineMustNotContain[0]");
int i = 0;
while (xfire_GetPrivateProfileString(temp, ret, "", ret2, 512, inipath))
@@ -663,7 +663,7 @@ void Scan4Games(LPVOID lparam)
newgame->appendString(ret2, &newgame->notcontain);
i++;
- mir_snprintf(ret, SIZEOF(ret), "CommandLineMustNotContain[%d]", i);
+ mir_snprintf(ret, _countof(ret), "CommandLineMustNotContain[%d]", i);
}
newgame->setNameandIcon();
@@ -725,7 +725,7 @@ void Scan4Games(LPVOID lparam)
int p = mir_strlen(gamelist) - 2;
if (p > -1)
gamelist[p] = 0; //letztes koma killen
- mir_snprintf(ret, SIZEOF(ret), Translate("Games found:%s%s"), "\r\n\r\n", gamelist);
+ mir_snprintf(ret, _countof(ret), Translate("Games found:%s%s"), "\r\n\r\n", gamelist);
MSGBOX(ret);
}
diff --git a/protocols/Xfire/src/setnickname.cpp b/protocols/Xfire/src/setnickname.cpp
index bfd5d3465a..d4eecf58c3 100644
--- a/protocols/Xfire/src/setnickname.cpp
+++ b/protocols/Xfire/src/setnickname.cpp
@@ -24,7 +24,7 @@ INT_PTR CALLBACK DlgNickProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
if (LOWORD(wParam) == IDOK)
{
char nick[255];
- GetDlgItemTextA(hwndDlg, IDC_NICKNAME, nick, SIZEOF(nick));
+ GetDlgItemTextA(hwndDlg, IDC_NICKNAME, nick, _countof(nick));
CallService(XFIRE_SET_NICK, 0, (LPARAM)nick);
diff --git a/protocols/Xfire/src/tools.cpp b/protocols/Xfire/src/tools.cpp
index ebd202f4d7..a38a70fe82 100644
--- a/protocols/Xfire/src/tools.cpp
+++ b/protocols/Xfire/src/tools.cpp
@@ -100,8 +100,8 @@ int displayPopup(HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT uType, HICON h
bIconsNotLoaded = FALSE;
}
- mir_tstrncpy(ppd.lptzContactName, _A2T(lpCaption), SIZEOF(ppd.lptzContactName));
- mir_tstrncpy(ppd.lptzText, _A2T(lpText), SIZEOF(ppd.lptzText));
+ mir_tstrncpy(ppd.lptzContactName, _A2T(lpCaption), _countof(ppd.lptzContactName));
+ mir_tstrncpy(ppd.lptzText, _A2T(lpText), _countof(ppd.lptzText));
if ((uType & MB_ICONMASK) == MB_ICONSTOP) {
ppd.lchIcon = hicError;
diff --git a/protocols/Xfire/src/userdetails.cpp b/protocols/Xfire/src/userdetails.cpp
index 37840a72c1..49e2cd2875 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, SIZEOF(url),"http://miniprofile.xfire.com/bg/sh/type/1/%s.png",fname);
+ mir_snprintf(url, _countof(url),"http://miniprofile.xfire.com/bg/sh/type/1/%s.png",fname);
char* buf = NULL;
unsigned int size = 0;
@@ -68,7 +68,7 @@ void SetItemTxt(HWND hwndDlg, int feldid, char*feld, MCONTACT hcontact, int type
if (type == 1)
{
char temp[255];
- mir_snprintf(temp, SIZEOF(temp), "%i", dbv.wVal);
+ mir_snprintf(temp, _countof(temp), "%i", dbv.wVal);
SetDlgItemTextA(hwndDlg, feldid, temp);
}
else
@@ -95,7 +95,7 @@ static int GetIPPortUDetails(MCONTACT hContact, char* feld1, char* feld2)
return 0;
char temp[255];
- mir_snprintf(temp, SIZEOF(temp), "%s:%d", dbv.pszVal, db_get_w(hContact, protocolname, feld2, -1));
+ mir_snprintf(temp, _countof(temp), "%s:%d", dbv.pszVal, db_get_w(hContact, protocolname, feld2, -1));
db_free(&dbv);
if (OpenClipboard(NULL)) {
@@ -380,30 +380,30 @@ char status[256]="";
char game[512]="";
if (!db_get(hContact,"ContactPhoto","File",&dbv))
{
-mir_snprintf(img,SIZEOF(img),"<img src=\"%s\">",dbv.pszVal);
+mir_snprintf(img,_countof(img),"<img src=\"%s\">",dbv.pszVal);
db_free(&dbv);
}
if (!db_get(hContact,protocolname,"Username",&dbv))
{
-mir_snprintf(username,SIZEOF(username),"<b>Username:</b> %s<br>",dbv.pszVal);
+mir_snprintf(username,_countof(username),"<b>Username:</b> %s<br>",dbv.pszVal);
db_free(&dbv);
}
if (!db_get(hContact,protocolname,"Nick",&dbv))
{
-mir_snprintf(nick,SIZEOF(nick),"<b>Nick:</b> %s<br>",dbv.pszVal);
+mir_snprintf(nick,_countof(nick),"<b>Nick:</b> %s<br>",dbv.pszVal);
db_free(&dbv);
}
if (!db_get(hContact,protocolname,"XStatusMsg",&dbv))
{
-mir_snprintf(status,SIZEOF(status),"<b>Status:</b> %s<br>",dbv.pszVal);
+mir_snprintf(status,_countof(status),"<b>Status:</b> %s<br>",dbv.pszVal);
db_free(&dbv);
}
if (!db_get(hContact,protocolname,"RGame",&dbv))
{
-mir_snprintf(game,SIZEOF(game),"<fieldset style='border:1px solid #0091d5;background-color:#0d2c3e;margin-bottom:8px;'><legend>Spiel</legend><table><tr><td valign=top style='font-family:Arial;font-size:11px;color:#fff;'><b><u>%s</u></b></td></tr></table></fieldset>",dbv.pszVal);
+mir_snprintf(game,_countof(game),"<fieldset style='border:1px solid #0091d5;background-color:#0d2c3e;margin-bottom:8px;'><legend>Spiel</legend><table><tr><td valign=top style='font-family:Arial;font-size:11px;color:#fff;'><b><u>%s</u></b></td></tr></table></fieldset>",dbv.pszVal);
db_free(&dbv);
}
-mir_snprintf(profil,SIZEOF(profil),"mshtml:<div style='position:absolute;top:0;left:0;border:1px solid #0091d5;background-color:#000;padding:6px;width:334px;height:249px'><table><tr><td valign=top>%s</td><td valign=top style='font-family:Arial;font-size:11px;color:#fff;'>%s%s%s</td></tr><tr><td valign=top colspan=\"2\" style='font-family:Arial;font-size:11px;color:#fff;'>%s%s</td></tr></table></div>",img,username,nick,status,game);
+mir_snprintf(profil,_countof(profil),"mshtml:<div style='position:absolute;top:0;left:0;border:1px solid #0091d5;background-color:#000;padding:6px;width:334px;height:249px'><table><tr><td valign=top>%s</td><td valign=top style='font-family:Arial;font-size:11px;color:#fff;'>%s%s%s</td></tr><tr><td valign=top colspan=\"2\" style='font-family:Arial;font-size:11px;color:#fff;'>%s%s</td></tr></table></div>",img,username,nick,status,game);
HWND hWnd = ::CreateWindow("AtlAxWin", profil,
WS_CHILD|WS_VISIBLE, 0, 0, 334, 249, hwndDlg, NULL,
::GetModuleHandle(NULL), NULL);
diff --git a/protocols/Xfire/src/variables.cpp b/protocols/Xfire/src/variables.cpp
index 86b5138bc9..e77c4e22b2 100644
--- a/protocols/Xfire/src/variables.cpp
+++ b/protocols/Xfire/src/variables.cpp
@@ -108,7 +108,7 @@ char* Varxfireserverip(ARGUMENTSINFO *ai) {
DBVARIANT dbv3;
if (!db_get(ai->fi->hContact, protocolname, "ServerIP", &dbv3))
{
- mir_snprintf(temp, SIZEOF(temp), "%s:%d", dbv3.pszVal, db_get_w(ai->fi->hContact, protocolname, "Port", 0));
+ mir_snprintf(temp, _countof(temp), "%s:%d", dbv3.pszVal, db_get_w(ai->fi->hContact, protocolname, "Port", 0));
db_free(&dbv3);
return mir_strdup(temp);
}
@@ -133,7 +133,7 @@ char* Varxfirevoiceip(ARGUMENTSINFO *ai) {
DBVARIANT dbv3;
if (!db_get(ai->fi->hContact, protocolname, "VServerIP", &dbv3))
{
- mir_snprintf(temp, SIZEOF(temp), "%s:%d", dbv3.pszVal, db_get_w(ai->fi->hContact, protocolname, "VPort", 0));
+ mir_snprintf(temp, _countof(temp), "%s:%d", dbv3.pszVal, db_get_w(ai->fi->hContact, protocolname, "VPort", 0));
db_free(&dbv3);
return mir_strdup(temp);
}