From 30ee89a6764a8d38a078374c6ed5de70635b42c0 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 16 Aug 2013 10:57:40 +0000 Subject: rest or mir_*printf in protocols git-svn-id: http://svn.miranda-ng.org/main/trunk@5715 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Xfire/src/SHA1.cpp | 8 ++++---- protocols/Xfire/src/Xfire_base.cpp | 28 ++++++++++++++-------------- protocols/Xfire/src/Xfire_icon_mng.cpp | 2 +- protocols/Xfire/src/Xfire_voicechat.cpp | 2 +- protocols/Xfire/src/addgamedialog.cpp | 16 ++++++++-------- protocols/Xfire/src/all_statusmsg.cpp | 2 +- protocols/Xfire/src/buddylist.cpp | 2 +- protocols/Xfire/src/clientloginpacket.cpp | 2 +- protocols/Xfire/src/iniupdater.cpp | 4 ++-- protocols/Xfire/src/main.cpp | 10 +++++----- protocols/Xfire/src/processbuddyinfo.cpp | 6 +++--- protocols/Xfire/src/tools.cpp | 4 ++-- protocols/Xfire/src/userdetails.cpp | 16 ++++++++-------- protocols/Xfire/src/variables.cpp | 4 ++-- 14 files changed, 53 insertions(+), 53 deletions(-) (limited to 'protocols/Xfire/src') diff --git a/protocols/Xfire/src/SHA1.cpp b/protocols/Xfire/src/SHA1.cpp index f296b563cd..cd0fe75149 100644 --- a/protocols/Xfire/src/SHA1.cpp +++ b/protocols/Xfire/src/SHA1.cpp @@ -232,23 +232,23 @@ void CSHA1::ReportHash(char *szReport, unsigned char uReportType) if(uReportType == REPORT_HEX) { - sprintf(szTemp, "%02X", m_digest[0]); + mir_snprintf(szTemp, SIZEOF(szTemp), "%02X", m_digest[0]); strcat(szReport, szTemp); for(i = 1; i < 20; i++) { - sprintf(szTemp, " %02X", m_digest[i]); + mir_snprintf(szTemp, SIZEOF(szTemp), " %02X", m_digest[i]); strcat(szReport, szTemp); } } else if(uReportType == REPORT_DIGIT) { - sprintf(szTemp, "%u", m_digest[0]); + mir_snprintf(szTemp, SIZEOF(szTemp), "%u", m_digest[0]); strcat(szReport, szTemp); for(i = 1; i < 20; i++) { - sprintf(szTemp, " %u", m_digest[i]); + mir_snprintf(szTemp, SIZEOF(szTemp), " %u", m_digest[i]); strcat(szReport, szTemp); } } diff --git a/protocols/Xfire/src/Xfire_base.cpp b/protocols/Xfire/src/Xfire_base.cpp index a2923968da..13f7c49afa 100644 --- a/protocols/Xfire/src/Xfire_base.cpp +++ b/protocols/Xfire/src/Xfire_base.cpp @@ -173,7 +173,7 @@ void Xfire_base::writeStringtoDB(char*name,unsigned int dbid,int id,char*val) return; //wert aus der dblesen - sprintf_s(temp,128,"%s_%i_%i",name,dbid,id); + mir_snprintf(temp, 128, "%s_%i_%i", name, dbid, id); db_set_s(NULL, protocolname, temp,val); } @@ -185,7 +185,7 @@ void Xfire_base::writeStringtoDB(char*name,unsigned int dbid,char*val) return; //wert aus der dblesen - sprintf_s(temp,128,"%s_%i",name,dbid); + mir_snprintf(temp, 128, "%s_%i", name, dbid); db_set_s(NULL, protocolname, temp,val); } @@ -197,7 +197,7 @@ void Xfire_base::writeUtf8StringtoDB(char*name,unsigned int dbid,int id,char*val return; //wert aus der dblesen - sprintf_s(temp,128,"%s_%i_%i",name,dbid,id); + mir_snprintf(temp, 128, "%s_%i_%i", name, dbid, id); db_set_utf(NULL, protocolname, temp,val); } @@ -209,7 +209,7 @@ void Xfire_base::writeUtf8StringtoDB(char*name,unsigned int dbid,char*val) return; //wert aus der dblesen - sprintf_s(temp,128,"%s_%i",name,dbid); + mir_snprintf(temp, 128, "%s_%i", name, dbid); db_set_utf(NULL, protocolname, temp,val); } @@ -222,7 +222,7 @@ void Xfire_base::writeBytetoDB(char*name,unsigned int dbid,int val) return; //wert aus der dblesen - sprintf_s(temp,128,"%s_%i",name,dbid); + mir_snprintf(temp, 128, "%s_%i", name, dbid); db_set_b(NULL, protocolname, temp, val); } @@ -234,7 +234,7 @@ void Xfire_base::writeWordtoDB(char*name,unsigned int dbid,int val) return; //wert aus der dblesen - sprintf_s(temp,128,"%s_%i",name,dbid); + mir_snprintf(temp, 128, "%s_%i", name, dbid); db_set_w(NULL, protocolname, temp, val); } @@ -247,7 +247,7 @@ unsigned char Xfire_base::readBytefromDB(char*name,unsigned int dbid,int default return 0; //wert aus der dblesen - sprintf_s(temp,128,"%s_%i",name,dbid); + mir_snprintf(temp, 128, "%s_%i", name, dbid); return db_get_b(NULL, protocolname, temp, defaultval); } @@ -259,7 +259,7 @@ unsigned int Xfire_base::readWordfromDB(char*name,unsigned int dbid,int defaultv return 0; //wert aus der dblesen - sprintf_s(temp,128,"%s_%i",name,dbid); + mir_snprintf(temp, 128, "%s_%i", name, dbid); return db_get_w(NULL, protocolname, temp, defaultval); } @@ -271,7 +271,7 @@ BOOL Xfire_base::removeDBEntry(char*name,unsigned int dbid) return 0; //wert aus der dblesen - sprintf_s(temp,128,"%s_%i",name,dbid); + mir_snprintf(temp, 128, "%s_%i", name, dbid); //eintrag entfernen if(!db_get(NULL, protocolname, temp,&dbv)) @@ -292,7 +292,7 @@ BOOL Xfire_base::removeDBEntry(char*name,unsigned int dbid,int id) return 0; //wert aus der dblesen - sprintf_s(temp,128,"%s_%i_%i",name,dbid,id); + mir_snprintf(temp, 128, "%s_%i_%i", name, dbid, id); //eintrag entfernen if(!db_get(NULL, protocolname, temp,&dbv)) @@ -463,7 +463,7 @@ BOOL Xfire_base::getIniValue(unsigned int gameid,unsigned int subid,const char* return FALSE; //kein pfad bug?!?! if(subid==0) { - sprintf_s(idstring,15,"%d",gameid); + mir_snprintf(idstring, 15, "%d", gameid); if(xfire_GetPrivateProfileString(idstring, valname, "", out, sizeofout, path)) return TRUE; @@ -471,7 +471,7 @@ BOOL Xfire_base::getIniValue(unsigned int gameid,unsigned int subid,const char* subid++; } - sprintf_s(idstring,15,"%d_%d",gameid,subid); + mir_snprintf(idstring, 15, "%d_%d", gameid, subid); if(xfire_GetPrivateProfileString(idstring, valname, "", out, sizeofout, path)) return TRUE; @@ -506,9 +506,9 @@ BOOL Xfire_base::getGamename(unsigned int gameid,char* out,int outsize){ //customnamen laden, wenn vorhanden DBVARIANT dbv; char dbstr[80]=""; - sprintf_s(dbstr,XFIRE_MAXSIZEOFGAMENAME,"customgamename_%d",gameid); + mir_snprintf(dbstr, XFIRE_MAXSIZEOFGAMENAME, "customgamename_%d", gameid); if(!db_get(NULL,protocolname,dbstr,&dbv)) { - sprintf_s(out,outsize,"%s",dbv.pszVal); + mir_snprintf(out, outsize, "%s", dbv.pszVal); db_free(&dbv); return TRUE; } diff --git a/protocols/Xfire/src/Xfire_icon_mng.cpp b/protocols/Xfire/src/Xfire_icon_mng.cpp index 0a583a6998..14abababea 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 - sprintf_s(resourcename,255,"XF_%s.ICO",shortname); + mir_snprintf(resourcename,255,"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 d14ae6f9d5..7a3ce804d2 100644 --- a/protocols/Xfire/src/Xfire_voicechat.cpp +++ b/protocols/Xfire/src/Xfire_voicechat.cpp @@ -165,7 +165,7 @@ void Xfire_voicechat::writeToDatabase(SendGameStatus2Packet* packet) { return; } //ip speichern - sprintf_s(temp,32,"%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,32,"%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 541d5eca30..0ea63d9219 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)); - sprintf_s(gameidtemp,10,"%d_%d",gameid,atoi(zahlbuffer2)); + mir_snprintf(gameidtemp,10,"%d_%d",gameid,atoi(zahlbuffer2)); } else { listentry.gameid=gameid; - sprintf_s(gameidtemp,10,"%d",gameid); + mir_snprintf(gameidtemp,10,"%d",gameid); } @@ -265,7 +265,7 @@ BOOL OpenFileDialog(HWND hwndDlg,OPENFILENAME*ofn,char*exe) { //kein backslash dann normal ret als exenamen verwenden if((int)exename==1) exename=exe; //filterstring aufbauen - sprintf(szFilter,"%s|%s|%s|*.*|",exename,exename,Translate("All Files")); + mir_snprintf(szFilter, SIZEOF(szFilter), "%s|%s|%s|*.*|", exename, exename, Translate("All Files")); //umbruch in 0 wandeln unsigned int sizeFilter=strlen(szFilter); for(unsigned int i=0;iszModuleName); char ttemp[128]=""; - sprintf_s(ttemp,128,"%s%s",temp[i]->szModuleName,PS_SETAWAYMSG); + mir_snprintf(ttemp,128,"%s%s",temp[i]->szModuleName,PS_SETAWAYMSG); //xfire wird geskipped, offline prots und invs prots auch, und locked status prots auch if(!temp[i]->bIsEnabled||statusid==ID_STATUS_INVISIBLE||statusid==ID_STATUS_OFFLINE||!lstrcmpiA( temp[i]->szModuleName, protocolname )||!ServiceExists(ttemp)||db_get_b(NULL,temp[i]->szModuleName,"LockMainStatus",0)==1) diff --git a/protocols/Xfire/src/buddylist.cpp b/protocols/Xfire/src/buddylist.cpp index d2ae949d7a..6106834065 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; - sprintf_s(temp,255,"Clan_%d",entry->clanid); + mir_snprintf(temp,255,"Clan_%d",entry->clanid); DBVARIANT dbv; if(!db_get(NULL,protocolname,temp,&dbv)) diff --git a/protocols/Xfire/src/clientloginpacket.cpp b/protocols/Xfire/src/clientloginpacket.cpp index 30a28cc7eb..1746b9fdf8 100644 --- a/protocols/Xfire/src/clientloginpacket.cpp +++ b/protocols/Xfire/src/clientloginpacket.cpp @@ -111,7 +111,7 @@ void ClientLoginPacket::hashSha1(const char *string, unsigned char *sha){ result[0] = 0; char szTemp[16]; for(int i = 0 ; i < 20 ; i++) { - sprintf(szTemp, "%02x", temp[i]); + mir_snprintf(szTemp, SIZEOF(szTemp), "%02x", temp[i]); strcat(result,szTemp); } memcpy(sha,result,40); diff --git a/protocols/Xfire/src/iniupdater.cpp b/protocols/Xfire/src/iniupdater.cpp index cc835332a4..dd82e010e8 100644 --- a/protocols/Xfire/src/iniupdater.cpp +++ b/protocols/Xfire/src/iniupdater.cpp @@ -61,7 +61,7 @@ void UpdateMyXFireIni(LPVOID dummy) { strcat(file2,"xfire_games.ini"); strcat(file3,"xfire_games.old"); - sprintf_s(request,1024,"%s%d",INI_URLREQUEST,getfilesize(file2)); + mir_snprintf(request,1024,"%s%d",INI_URLREQUEST,getfilesize(file2)); if(CheckWWWContent(request)) { @@ -101,7 +101,7 @@ void UpdateMyIcons(LPVOID dummy) { strcat(file2,"icons.dll"); strcat(file3,"icons.old"); - sprintf_s(request,1024,"%s%d",ICO_URLREQUEST,getfilesize(file2)); + mir_snprintf(request,1024,"%s%d",ICO_URLREQUEST,getfilesize(file2)); if(CheckWWWContent(request)) { diff --git a/protocols/Xfire/src/main.cpp b/protocols/Xfire/src/main.cpp index 17891ac6ec..f2d80d8d1e 100644 --- a/protocols/Xfire/src/main.cpp +++ b/protocols/Xfire/src/main.cpp @@ -491,7 +491,7 @@ void XFireClient::sendmsg(char*usr,char*cmsg) { char temp[255]; char * dummy; ClanBuddyListNamesPacket *clan = (ClanBuddyListNamesPacket*)content; - sprintf(temp,"Clan_%d",clan->clanid); + mir_snprintf(temp, SIZEOF(temp), "Clan_%d", clan->clanid); DBVARIANT dbv; if(!db_get(NULL,protocolname,temp,&dbv)) @@ -2389,7 +2389,7 @@ void gamedetectiont(LPVOID lparam) if(packet->ip[3]!=0) { - sprintf(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, 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); db_set_s(NULL, protocolname, "VServerIP", temp); db_set_s(NULL, protocolname, "currentvoicename", "Teamspeak"); } @@ -2429,7 +2429,7 @@ void gamedetectiont(LPVOID lparam) db_set_w(NULL,protocolname,"currentvoice",vid); - sprintf(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, 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); db_set_s(NULL, protocolname, "VServerIP", temp); if(myClient!=NULL) @@ -2469,7 +2469,7 @@ void gamedetectiont(LPVOID lparam) packet->gameid=vid; db_set_w(NULL,protocolname,"currentvoice",vid); - sprintf(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, 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); db_set_s(NULL, protocolname, "VServerIP", temp); if(myClient!=NULL) @@ -3586,7 +3586,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); - sprintf(temp,"before: %d after: %d",before,icocache[i].handle); + mir_snprintf(temp, SIZEOF(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/processbuddyinfo.cpp b/protocols/Xfire/src/processbuddyinfo.cpp index 32ac9d9808..b23d51b531 100644 --- a/protocols/Xfire/src/processbuddyinfo.cpp +++ b/protocols/Xfire/src/processbuddyinfo.cpp @@ -58,7 +58,7 @@ void ProcessBuddyInfo(xfirelib::BuddyInfoPacket *buddyinfo,HANDLE hcontact,char* strcat(filename,".gif"); type=PA_FORMAT_GIF; - sprintf(temp,"/xfire/xf/images/avatars/gallery/default/%03d.gif",buddyinfo->avatarid); + mir_snprintf(temp, SIZEOF(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,HANDLE hcontact,char* strcat(filename,".jpg"); type=PA_FORMAT_JPEG; - sprintf(temp,"/avatar/100/%s.jpg?%d",username,buddyinfo->avatarid); + mir_snprintf(temp, SIZEOF(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,HANDLE hcontact,char* type=PA_FORMAT_GIF; strcat(filename,"xfire.gif"); - sprintf(temp,"/xfire/xf/images/avatars/gallery/default/xfire.gif",buddyinfo->avatarid); + mir_snprintf(temp, SIZEOF(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/tools.cpp b/protocols/Xfire/src/tools.cpp index 9cfbb44662..e662defe91 100644 --- a/protocols/Xfire/src/tools.cpp +++ b/protocols/Xfire/src/tools.cpp @@ -42,9 +42,9 @@ extern HANDLE hNetlib; for(int i=0;i",dbv.pszVal); + mir_snprintf(img,256,"",dbv.pszVal); db_free(&dbv); } if(!db_get(hContact,protocolname,"Username",&dbv)) { - snprintf(username,256,"Username: %s
",dbv.pszVal); + mir_snprintf(username,256,"Username: %s
",dbv.pszVal); db_free(&dbv); } if(!db_get(hContact,protocolname,"Nick",&dbv)) { - snprintf(nick,256,"Nick: %s
",dbv.pszVal); + mir_snprintf(nick,256,"Nick: %s
",dbv.pszVal); db_free(&dbv); } if(!db_get(hContact,protocolname,"XStatusMsg",&dbv)) { - snprintf(status,256,"Status: %s
",dbv.pszVal); + mir_snprintf(status,256,"Status: %s
",dbv.pszVal); db_free(&dbv); } if(!db_get(hContact,protocolname,"RGame",&dbv)) { - snprintf(game,512,"
Spiel
%s
",dbv.pszVal); + mir_snprintf(game,512,"
Spiel
%s
",dbv.pszVal); db_free(&dbv); } - snprintf(profil,2056,"mshtml:
%s%s%s%s
%s%s
",img,username,nick,status,game); + mir_snprintf(profil,2056,"mshtml:
%s%s%s%s
%s%s
",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 34c1dec6f2..f23a47966c 100644 --- a/protocols/Xfire/src/variables.cpp +++ b/protocols/Xfire/src/variables.cpp @@ -114,7 +114,7 @@ char* Varxfireserverip(ARGUMENTSINFO *ai) { DBVARIANT dbv3; if(!db_get(ai->fi->hContact,protocolname, "ServerIP",&dbv3)) { - sprintf(temp,"%s:%d",dbv3.pszVal,db_get_w(ai->fi->hContact,protocolname, "Port",0)); + mir_snprintf(temp, SIZEOF(temp), "%s:%d", dbv3.pszVal, db_get_w(ai->fi->hContact, protocolname, "Port", 0)); db_free(&dbv3); return mir_strdup(temp); } @@ -141,7 +141,7 @@ char* Varxfirevoiceip(ARGUMENTSINFO *ai) { DBVARIANT dbv3; if(!db_get(ai->fi->hContact,protocolname, "VServerIP",&dbv3)) { - sprintf(temp,"%s:%d",dbv3.pszVal,db_get_w(ai->fi->hContact,protocolname, "VPort",0)); + mir_snprintf(temp, SIZEOF(temp), "%s:%d", dbv3.pszVal, db_get_w(ai->fi->hContact, protocolname, "VPort", 0)); db_free(&dbv3); return mir_strdup(temp); } -- cgit v1.2.3