diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2015-05-22 10:06:32 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2015-05-22 10:06:32 +0000 |
commit | 5a17c9299e03bebf46169927abdeee34aaf8e854 (patch) | |
tree | cbd13080f33ac0b6396b9d3b8ba31a3c98de59f8 /protocols | |
parent | ed64312924e77707e7e5b5965c301692519f293a (diff) |
replace strlen to mir_strlen
git-svn-id: http://svn.miranda-ng.org/main/trunk@13747 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
116 files changed, 608 insertions, 608 deletions
diff --git a/protocols/AimOscar/src/avatars.cpp b/protocols/AimOscar/src/avatars.cpp index 2d6de87415..0ecf63cb42 100644 --- a/protocols/AimOscar/src/avatars.cpp +++ b/protocols/AimOscar/src/avatars.cpp @@ -34,7 +34,7 @@ void __cdecl CAimProto::avatar_request_thread(void* param) }
char type = getByte(hContact, AIM_KEY_AHT, 1);
- size_t len = (strlen(hash_str) + 1) / 2;
+ size_t len = (mir_strlen(hash_str) + 1) / 2;
char* hash = (char*)alloca(len);
string_to_bytes(hash_str, hash);
debugLogA("Requesting an Avatar: %s (Hash: %s)", sn, hash_str);
diff --git a/protocols/AimOscar/src/away.cpp b/protocols/AimOscar/src/away.cpp index 3b1665e2c9..ec8fdbb4fa 100644 --- a/protocols/AimOscar/src/away.cpp +++ b/protocols/AimOscar/src/away.cpp @@ -49,12 +49,12 @@ int CAimProto::aim_set_away(HANDLE hServerConn, unsigned short &seqno, const cha if (!amsg) return -1;
setDword(AIM_KEY_LA, (DWORD)time(NULL));
html_msg = html_encode(amsg && amsg[0] ? amsg : DEFAULT_AWAY_MSG);
- msg_size = strlen(html_msg);
+ msg_size = mir_strlen(html_msg);
}
aimString str(html_msg);
const char *charset = str.isUnicode() ? AIM_MSG_TYPE_UNICODE : AIM_MSG_TYPE;
- const unsigned short charset_len = (unsigned short)strlen(charset);
+ const unsigned short charset_len = (unsigned short)mir_strlen(charset);
const char* msg = str.getBuf();
const unsigned short msg_len = str.getSize();
@@ -108,7 +108,7 @@ int CAimProto::aim_set_statusmsg(HANDLE hServerConn, unsigned short &seqno, cons int CAimProto::aim_query_away_message(HANDLE hServerConn, unsigned short &seqno, const char* sn)
{
unsigned short offset = 0;
- unsigned short sn_length = (unsigned short)strlen(sn);
+ unsigned short sn_length = (unsigned short)mir_strlen(sn);
char *buf = (char*)alloca(SNAC_SIZE + 5 + sn_length);
aim_writesnac(0x02, 0x15, offset, buf);
aim_writegeneric(4, "\0\0\0\x02", offset, buf);
diff --git a/protocols/AimOscar/src/client.cpp b/protocols/AimOscar/src/client.cpp index a766db7187..169003f94c 100644 --- a/protocols/AimOscar/src/client.cpp +++ b/protocols/AimOscar/src/client.cpp @@ -26,9 +26,9 @@ int CAimProto::aim_send_connection_packet(HANDLE hServerConn,unsigned short &seq int CAimProto::aim_authkey_request(HANDLE hServerConn,unsigned short &seqno)
{
unsigned short offset=0;
- char* buf=(char*)alloca(SNAC_SIZE+TLV_HEADER_SIZE*3+strlen(username));
+ char* buf=(char*)alloca(SNAC_SIZE+TLV_HEADER_SIZE*3+mir_strlen(username));
aim_writesnac(0x17,0x06,offset,buf);
- aim_writetlv(0x01,(unsigned short)strlen(username),username,offset,buf);
+ aim_writetlv(0x01,(unsigned short)mir_strlen(username),username,offset,buf);
aim_writetlv(0x4B,0,0,offset,buf);
aim_writetlv(0x5A,0,0,offset,buf);
return aim_sendflap(hServerConn,0x02,offset,buf,seqno);
@@ -43,10 +43,10 @@ int CAimProto::aim_auth_request(HANDLE hServerConn,unsigned short &seqno,const c mir_md5_state_t state;
mir_md5_init(&state);
- mir_md5_append(&state,(const BYTE *)password, (int)strlen(password));
+ mir_md5_append(&state,(const BYTE *)password, (int)mir_strlen(password));
mir_md5_finish(&state,pass_hash);
mir_md5_init(&state);
- mir_md5_append(&state,(BYTE*)key, (int)strlen(key));
+ mir_md5_append(&state,(BYTE*)key, (int)mir_strlen(key));
mir_md5_append(&state,(BYTE*)pass_hash,MD5_HASH_LENGTH);
mir_md5_append(&state,(BYTE*)AIM_MD5_STRING, sizeof(AIM_MD5_STRING)-1);
mir_md5_finish(&state,auth_hash);
@@ -55,10 +55,10 @@ int CAimProto::aim_auth_request(HANDLE hServerConn,unsigned short &seqno,const c CallService(MS_SYSTEM_GETVERSIONTEXT, sizeof(mirver), (LPARAM)mirver);
int client_id_len = mir_snprintf(client_id, SIZEOF(client_id), "Miranda AIM, version %s", mirver);
- char* buf=(char*)alloca(SNAC_SIZE+TLV_HEADER_SIZE*14+MD5_HASH_LENGTH+strlen(username)+client_id_len+30+strlen(language)+strlen(country));
+ 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));
aim_writesnac(0x17,0x02,offset,buf);
- aim_writetlv(0x01,(unsigned short)strlen(username),username,offset,buf);
+ aim_writetlv(0x01,(unsigned short)mir_strlen(username),username,offset,buf);
aim_writetlv(0x25,MD5_HASH_LENGTH,(char*)auth_hash,offset,buf);
aim_writetlv(0x4C,0,0,offset,buf);//signifies new password hash instead of old method
aim_writetlv(0x03,(unsigned short)client_id_len,client_id,offset,buf);
@@ -68,8 +68,8 @@ int CAimProto::aim_auth_request(HANDLE hServerConn,unsigned short &seqno,const c aim_writetlvshort(0x1A,AIM_CLIENT_BUILD_NUMBER,offset,buf);
aim_writetlvshort(0x16,AIM_CLIENT_ID_NUMBER,offset,buf);
aim_writetlvlong(0x14,AIM_CLIENT_DISTRIBUTION_NUMBER,offset,buf);
- aim_writetlv(0x0F,(unsigned short)strlen(language),language,offset,buf);
- aim_writetlv(0x0E,(unsigned short)strlen(country),country,offset,buf);
+ aim_writetlv(0x0F,(unsigned short)mir_strlen(language),language,offset,buf);
+ aim_writetlv(0x0E,(unsigned short)mir_strlen(country),country,offset,buf);
aim_writetlvchar(0x4A,getByte(AIM_KEY_FSC, 0) ? 3 : 1,offset,buf);
// aim_writetlvchar(0x94,0,offset,buf);
if (!getByte(AIM_KEY_DSSL, 0))
@@ -234,7 +234,7 @@ int CAimProto::aim_set_profile(HANDLE hServerConn,unsigned short &seqno, char* a {
aimString str(amsg);
const char *charset = str.isUnicode() ? AIM_MSG_TYPE_UNICODE : AIM_MSG_TYPE;
- const unsigned short charset_len = (unsigned short)strlen(charset);
+ const unsigned short charset_len = (unsigned short)mir_strlen(charset);
const char* msg = str.getBuf();
const unsigned short msg_len = str.getSize();
@@ -356,7 +356,7 @@ int CAimProto::aim_send_message(HANDLE hServerConn,unsigned short &seqno,const c aim_writegeneric(msg_len,msg,tlv_offset,tlv_buf); // message text
unsigned short offset=0;
- unsigned short sn_length=(unsigned short)strlen(sn);
+ unsigned short sn_length=(unsigned short)mir_strlen(sn);
char* buf= (char*)alloca(SNAC_SIZE+8+3+sn_length+TLV_HEADER_SIZE*3+tlv_offset);
aim_writesnac(0x04,0x06,offset,buf,get_random());
@@ -383,7 +383,7 @@ int CAimProto::aim_send_message(HANDLE hServerConn,unsigned short &seqno,const c int CAimProto::aim_query_profile(HANDLE hServerConn,unsigned short &seqno,char* sn)
{
unsigned short offset=0;
- unsigned short sn_length=(unsigned short)strlen(sn);
+ unsigned short sn_length=(unsigned short)mir_strlen(sn);
char* buf=(char*)alloca(SNAC_SIZE+5+sn_length);
aim_writesnac(0x02,0x15,offset,buf);
aim_writelong(0x01,offset,buf);
@@ -396,7 +396,7 @@ int CAimProto::aim_delete_contact(HANDLE hServerConn, unsigned short &seqno, cha unsigned short group_id, unsigned short list, bool nil)
{
unsigned short offset=0;
- unsigned short sn_length=(unsigned short)strlen(sn);
+ unsigned short sn_length=(unsigned short)mir_strlen(sn);
char* buf=(char*)alloca(SNAC_SIZE+sn_length+10);
aim_writesnac(0x13,0x0a,offset,buf, get_random()); // SSI Delete
aim_writeshort(sn_length,offset,buf); // screen name length
@@ -413,7 +413,7 @@ int CAimProto::aim_add_contact(HANDLE hServerConn, unsigned short &seqno, const unsigned short group_id, unsigned short list, char* nick, char* note)
{
unsigned short offset=0;
- unsigned short sn_length=(unsigned short)strlen(sn);
+ unsigned short sn_length=(unsigned short)mir_strlen(sn);
unsigned short nick_length = (unsigned short)mir_strlen(nick);
unsigned short note_length = (unsigned short)mir_strlen(note);
unsigned short tlv_len = nick || note ? TLV_HEADER_SIZE * 2 + nick_length + note_length : 0;
@@ -439,7 +439,7 @@ int CAimProto::aim_mod_group(HANDLE hServerConn, unsigned short &seqno, const ch char* members, unsigned short members_length)
{
unsigned short offset=0;
- unsigned short name_length=(unsigned short)strlen(name);
+ unsigned short name_length=(unsigned short)mir_strlen(name);
char* buf=(char*)alloca(SNAC_SIZE+TLV_HEADER_SIZE+name_length+members_length+10);
aim_writesnac(0x13,0x09,offset,buf, get_random()); // SSI Edit
aim_writeshort(name_length,offset,buf); // group name length
@@ -457,7 +457,7 @@ int CAimProto::aim_mod_buddy(HANDLE hServerConn, unsigned short &seqno, const ch char* nick, char* note)
{
unsigned short offset=0;
- unsigned short sn_length = (unsigned short)strlen(sn);
+ unsigned short sn_length = (unsigned short)mir_strlen(sn);
unsigned short nick_length = (unsigned short)mir_strlen(nick);
unsigned short note_length = (unsigned short)mir_strlen(note);
unsigned short tlv_len = TLV_HEADER_SIZE * 2 + nick_length + note_length;
@@ -574,7 +574,7 @@ int CAimProto::aim_send_file(HANDLE hServerConn, unsigned short &seqno, aimString dscr(ft->message);
const char* charset = dscr.isUnicode() ? "unicode-2-0" : "us-ascii";
- const unsigned short charset_len = (unsigned short)strlen(charset);
+ const unsigned short charset_len = (unsigned short)mir_strlen(charset);
const char* desc_msg = dscr.getBuf();
const unsigned short desc_len = dscr.getSize();
@@ -587,7 +587,7 @@ int CAimProto::aim_send_file(HANDLE hServerConn, unsigned short &seqno, aim_writetlv(0x0f,0,0,frag_offset,msg_frag); // request host check
const char* fname = get_fname(ft->file);
- const unsigned short fnlen = (unsigned short)strlen(fname);
+ const unsigned short fnlen = (unsigned short)mir_strlen(fname);
char* fblock = (char*)alloca(9 + fnlen);
*(unsigned short*)&fblock[0] = _htons(ft->pfts.totalFiles > 1 ? 2 : 1); // single file transfer
@@ -608,7 +608,7 @@ int CAimProto::aim_send_file(HANDLE hServerConn, unsigned short &seqno, }
unsigned short offset=0;
- unsigned short sn_length=(unsigned short)strlen(ft->sn);
+ unsigned short sn_length=(unsigned short)mir_strlen(ft->sn);
char* buf=(char*)alloca(SNAC_SIZE+TLV_HEADER_SIZE*2+12+frag_offset+sn_length);
aim_writesnac(0x04,0x06,offset,buf); // msg to host
aim_writegeneric(8,ft->icbm_cookie,offset,buf); // icbm cookie
@@ -637,7 +637,7 @@ int CAimProto::aim_file_ad(HANDLE hServerConn,unsigned short &seqno,char* sn, ch // if (max_ver > 1)
// aim_writetlvshort(0x12,2,frag_offset,msg_frag); // max protocol version
- unsigned short sn_length=(unsigned short)strlen(sn);
+ unsigned short sn_length=(unsigned short)mir_strlen(sn);
unsigned short offset=0;
char* buf=(char*)alloca(SNAC_SIZE+TLV_HEADER_SIZE+21+frag_offset+sn_length);
aim_writesnac(0x04,0x06,offset,buf); // msg to host
@@ -654,7 +654,7 @@ int CAimProto::aim_file_ad(HANDLE hServerConn,unsigned short &seqno,char* sn, ch int CAimProto::aim_typing_notification(HANDLE hServerConn,unsigned short &seqno,char* sn,unsigned short type)
{
unsigned short offset=0;
- unsigned short sn_length=(unsigned short)strlen(sn);
+ unsigned short sn_length=(unsigned short)mir_strlen(sn);
char* buf= (char*)alloca(SNAC_SIZE+sn_length+13);
aim_writesnac(0x04,0x14,offset,buf);
aim_writegeneric(8,"\0\0\0\0\0\0\0\0",offset,buf); // icbm cookie
@@ -699,7 +699,7 @@ int CAimProto::aim_activate_mail(HANDLE hServerConn,unsigned short &seqno) int CAimProto::aim_request_avatar(HANDLE hServerConn,unsigned short &seqno, const char* sn, unsigned short bart_type, const char* hash, unsigned short hash_size)
{
unsigned short offset=0;
- unsigned char sn_length=(unsigned char)strlen(sn);
+ unsigned char sn_length=(unsigned char)mir_strlen(sn);
char* buf= (char*)alloca(SNAC_SIZE+sn_length+hash_size+12);
aim_writesnac(0x10,0x06,offset,buf);
aim_writechar(sn_length,offset,buf); // screen name length
@@ -715,7 +715,7 @@ int CAimProto::aim_set_avatar_hash(HANDLE hServerConn, unsigned short &seqno, ch char bart_type_txt[8];
ultoa(bart_type, bart_type_txt, 10);
- unsigned short bart_type_len = (unsigned short)strlen(bart_type_txt);
+ unsigned short bart_type_len = (unsigned short)mir_strlen(bart_type_txt);
unsigned short req = 0x09;
if (id == 0)
@@ -751,7 +751,7 @@ int CAimProto::aim_delete_avatar_hash(HANDLE hServerConn, unsigned short &seqno, char bart_type_txt[8];
ultoa(bart_type, bart_type_txt, 10);
- unsigned short bart_type_len = (unsigned short)strlen(bart_type_txt);
+ unsigned short bart_type_len = (unsigned short)mir_strlen(bart_type_txt);
char* buf = (char*)alloca(SNAC_SIZE + 20 + bart_type_len);
aim_writesnac(0x13,0x0a,offset,buf, get_random()); // SSI Delete
@@ -779,7 +779,7 @@ int CAimProto::aim_upload_avatar(HANDLE hServerConn, unsigned short &seqno, unsi int CAimProto::aim_search_by_email(HANDLE hServerConn,unsigned short &seqno, const char* email)
{
unsigned short offset=0;
- char em_length=(char)strlen(email);
+ char em_length=(char)mir_strlen(email);
char* buf= (char*)alloca(SNAC_SIZE+em_length);
aim_writesnac(0x0a,0x02,offset,buf); // Email search
aim_writegeneric(em_length,email,offset,buf);
@@ -797,7 +797,7 @@ int CAimProto::aim_chatnav_request_limits(HANDLE hServerConn,unsigned short &seq int CAimProto::aim_chatnav_create(HANDLE hServerConn,unsigned short &seqno, char* room, unsigned short exchage)
{
//* Join Pseudo Room (Get's the info we need for the real connection)
- unsigned short room_len = (unsigned short)strlen(room);
+ unsigned short room_len = (unsigned short)mir_strlen(room);
unsigned short offset=0;
char* buf=(char*)alloca(SNAC_SIZE+10+room_len+26);
@@ -818,7 +818,7 @@ int CAimProto::aim_chatnav_create(HANDLE hServerConn,unsigned short &seqno, char int CAimProto::aim_chatnav_room_info(HANDLE hServerConn,unsigned short &seqno, char* chat_cookie, unsigned short exchange, unsigned short instance)
{
unsigned short offset=0;
- unsigned short chat_cookie_len = (unsigned short)strlen(chat_cookie);
+ unsigned short chat_cookie_len = (unsigned short)mir_strlen(chat_cookie);
char* buf=(char*)alloca(SNAC_SIZE+7+chat_cookie_len);
aim_writesnac(0x0d,0x04,offset,buf);
aim_writeshort(exchange,offset,buf); // Exchange
@@ -833,7 +833,7 @@ int CAimProto::aim_chat_join_room(HANDLE hServerConn,unsigned short &seqno, char unsigned short exchange, unsigned short instance, unsigned short id)
{
unsigned short offset=0;
- unsigned short cookie_len = (unsigned short)strlen(chat_cookie);
+ unsigned short cookie_len = (unsigned short)mir_strlen(chat_cookie);
char* buf=(char*)alloca(SNAC_SIZE+TLV_HEADER_SIZE*2+cookie_len+8);
aim_writesnac(0x01,0x04,offset,buf,id);
aim_writeshort(0x0e,offset,buf); // Service request for Chat
@@ -856,7 +856,7 @@ int CAimProto::aim_chat_send_message(HANDLE hServerConn, unsigned short &seqno, aimString str(amsg);
const char* charset = str.isUnicode() ? "unicode-2-0" : "us-ascii";
- const unsigned short chrset_len = (unsigned short)strlen(charset);
+ const unsigned short chrset_len = (unsigned short)mir_strlen(charset);
const char* msg = str.getBuf();
const unsigned short msg_len = str.getSize();
@@ -883,9 +883,9 @@ int CAimProto::aim_chat_send_message(HANDLE hServerConn, unsigned short &seqno, int CAimProto::aim_chat_invite(HANDLE hServerConn,unsigned short &seqno, char* chat_cookie, unsigned short exchange, unsigned short instance, char* sn, char* msg)
{
unsigned short offset=0;
- unsigned short chat_cookie_len = (unsigned short)strlen(chat_cookie);
- unsigned short sn_len = (unsigned short)strlen(sn);
- unsigned short msg_len = (unsigned short)strlen(msg);
+ unsigned short chat_cookie_len = (unsigned short)mir_strlen(chat_cookie);
+ unsigned short sn_len = (unsigned short)mir_strlen(sn);
+ unsigned short msg_len = (unsigned short)mir_strlen(msg);
char* buf=(char*)alloca(SNAC_SIZE+64+chat_cookie_len+sn_len+msg_len);
aim_writesnac(0x04,0x06,offset,buf);
aim_writegeneric(8,"\0\0\0\0\0\0\0\0",offset,buf); // ICBM Cookie
@@ -917,7 +917,7 @@ int CAimProto::aim_chat_invite(HANDLE hServerConn,unsigned short &seqno, char* c int CAimProto::aim_chat_deny(HANDLE hServerConn,unsigned short &seqno,char* sn,char* icbm_cookie)
{
unsigned short offset=0;
- unsigned short sn_length=(unsigned short)strlen(sn);
+ unsigned short sn_length=(unsigned short)mir_strlen(sn);
char* buf=(char*)alloca(SNAC_SIZE+20+sn_length);
aim_writesnac(0x04,0x0b,offset,buf);
aim_writegeneric(8,icbm_cookie,offset,buf); // ICBM Cookie
@@ -945,7 +945,7 @@ int CAimProto::aim_admin_ready(HANDLE hServerConn,unsigned short &seqno) int CAimProto::aim_admin_format_name(HANDLE hServerConn,unsigned short &seqno, const char* sn)
{
unsigned short offset=0;
- unsigned short sn_len = (unsigned short)strlen(sn);
+ unsigned short sn_len = (unsigned short)mir_strlen(sn);
char* buf=(char*)alloca(SNAC_SIZE+TLV_HEADER_SIZE+sn_len);
aim_writesnac(0x07,0x04,offset,buf);
aim_writetlv(0x01,sn_len,sn,offset,buf);
@@ -955,7 +955,7 @@ int CAimProto::aim_admin_format_name(HANDLE hServerConn,unsigned short &seqno, c int CAimProto::aim_admin_change_email(HANDLE hServerConn,unsigned short &seqno, const char* email)
{
unsigned short offset=0;
- unsigned short email_len = (unsigned short)strlen(email);
+ unsigned short email_len = (unsigned short)mir_strlen(email);
char* buf=(char*)alloca(SNAC_SIZE+TLV_HEADER_SIZE+email_len);
aim_writesnac(0x07,0x04,offset,buf);
aim_writetlv(0x11,email_len,email,offset,buf);
@@ -965,8 +965,8 @@ int CAimProto::aim_admin_change_email(HANDLE hServerConn,unsigned short &seqno, int CAimProto::aim_admin_change_password(HANDLE hServerConn,unsigned short &seqno, const char* cur_pw, const char* new_pw)
{
unsigned short offset=0;
- unsigned short cur_pw_len = (unsigned short)strlen(cur_pw);
- unsigned short new_pw_len = (unsigned short)strlen(new_pw);
+ unsigned short cur_pw_len = (unsigned short)mir_strlen(cur_pw);
+ unsigned short new_pw_len = (unsigned short)mir_strlen(new_pw);
char* buf=(char*)alloca(SNAC_SIZE+2*TLV_HEADER_SIZE+cur_pw_len+new_pw_len);
aim_writesnac(0x07,0x04,offset,buf);
aim_writetlv(0x02,new_pw_len,new_pw,offset,buf);
diff --git a/protocols/AimOscar/src/conv.cpp b/protocols/AimOscar/src/conv.cpp index faa4bdc01c..f0458f7fde 100644 --- a/protocols/AimOscar/src/conv.cpp +++ b/protocols/AimOscar/src/conv.cpp @@ -23,10 +23,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. char* process_status_msg (const char *str, const char* sn)
{
const char *src = str;
- size_t size = strlen(src) + 1;
+ size_t size = mir_strlen(src) + 1;
char* res = (char*)mir_alloc(size);
char* dest = res;
- size_t len = strlen(sn);
+ size_t len = mir_strlen(sn);
for (; *src; ++src)
{
@@ -77,7 +77,7 @@ char* process_status_msg (const char *str, const char* sn) void html_decode(char* str)
{
char *p, *q;
-// char *rstr = (char*)mir_alloc(strlen(str)*2);
+// char *rstr = (char*)mir_alloc(mir_strlen(str)*2);
if (str == NULL) return;
@@ -100,7 +100,7 @@ void html_decode(char* str) if (t1 && *t1)
{
strcpy(q, t1);
- q += strlen(t1) - 1;
+ q += mir_strlen(t1) - 1;
}
mir_free(t1);
p = s;
@@ -214,8 +214,8 @@ char* html_to_bbcodes(char *src) }
else
{
- dest=(char*)mir_realloc(dest,strlen(dest)+6);
- memcpy(&dest[strlen(dest)],"[/b]",5);
+ dest=(char*)mir_realloc(dest,mir_strlen(dest)+6);
+ memcpy(&dest[mir_strlen(dest)],"[/b]",5);
}
}
while ((ptr = strstr(dest, "<I>")) != NULL || (ptr = strstr(dest, "<i>")) != NULL)
@@ -231,8 +231,8 @@ char* html_to_bbcodes(char *src) }
else
{
- dest=(char*)mir_realloc(dest,strlen(dest)+6);
- memcpy(&dest[strlen(dest)],"[/i]",5);
+ dest=(char*)mir_realloc(dest,mir_strlen(dest)+6);
+ memcpy(&dest[mir_strlen(dest)],"[/i]",5);
}
}
while ((ptr = strstr(dest, "<U>")) != NULL || (ptr = strstr(dest, "<u>")) != NULL)
@@ -248,8 +248,8 @@ char* html_to_bbcodes(char *src) }
else
{
- dest=(char*)mir_realloc(dest,strlen(dest)+6);
- memcpy(&dest[strlen(dest)],"[/u]",5);
+ dest=(char*)mir_realloc(dest,mir_strlen(dest)+6);
+ memcpy(&dest[mir_strlen(dest)],"[/u]",5);
}
}
while ((ptr = strstr(dest, "<S>")) != NULL || (ptr = strstr(dest, "<s>")) != NULL)
@@ -265,8 +265,8 @@ char* html_to_bbcodes(char *src) }
else
{
- dest=(char*)mir_realloc(dest,strlen(dest)+6);
- memcpy(&dest[strlen(dest)],"[/s]",5);
+ dest=(char*)mir_realloc(dest,mir_strlen(dest)+6);
+ memcpy(&dest[mir_strlen(dest)],"[/s]",5);
}
}
rptr = dest;
@@ -275,11 +275,11 @@ char* html_to_bbcodes(char *src) char* begin=ptr;
ptrl = ptr + 4;
memcpy(ptrl,"[url=",5);
- memmove(ptr, ptrl, strlen(ptrl) + 1);
+ memmove(ptr, ptrl, mir_strlen(ptrl) + 1);
if ((ptr = strstr(ptrl,">")))
{
ptr-=1;
- memmove(ptr, ptr+1, strlen(ptr+1) + 1);
+ memmove(ptr, ptr+1, mir_strlen(ptr+1) + 1);
*(ptr)=']';
ptrl-=1;
char* s1 = strstr(ptrl,"</A");
@@ -288,7 +288,7 @@ char* html_to_bbcodes(char *src) {
ptr=s1;
ptr=strip_tag_within(begin,ptr);
- memmove(ptr+2, ptr, strlen(ptr) + 1);
+ memmove(ptr+2, ptr, mir_strlen(ptr) + 1);
memcpy(ptr,"[/url]",6);
}
else if (s2&&s2<s1||s2&&!s1)
@@ -296,20 +296,20 @@ char* html_to_bbcodes(char *src) ptr=s2;
ptr=strip_tag_within(begin,ptr);
int addr=ptr-rptr;
- dest=(char*)mir_realloc(dest,strlen(dest)+8);
+ dest=(char*)mir_realloc(dest,mir_strlen(dest)+8);
rptr=dest;
ptr=rptr+addr;
- memmove(ptr+6, ptr, strlen(ptr) + 1);
+ memmove(ptr+6, ptr, mir_strlen(ptr) + 1);
memcpy(ptr,"[/url]",6);
}
else
{
- strip_tag_within(begin,&dest[strlen(dest)]);
+ strip_tag_within(begin,&dest[mir_strlen(dest)]);
//int addr=ptr-rptr;
- dest=(char*)mir_realloc(dest,strlen(dest)+8);
+ dest=(char*)mir_realloc(dest,mir_strlen(dest)+8);
rptr=dest;
ptr=dest;
- memcpy(&ptr[strlen(ptr)],"[/url]",7);
+ memcpy(&ptr[mir_strlen(ptr)],"[/url]",7);
}
}
else
@@ -321,11 +321,11 @@ char* html_to_bbcodes(char *src) char* begin=ptr;
ptrl = ptr + 4;
memcpy(ptrl,"[url=",5);
- memmove(ptr, ptrl, strlen(ptrl) + 1);
+ memmove(ptr, ptrl, mir_strlen(ptrl) + 1);
if ((ptr = strstr(ptrl,">")))
{
ptr-=1;
- memmove(ptr, ptr+1, strlen(ptr+1) + 1);
+ memmove(ptr, ptr+1, mir_strlen(ptr+1) + 1);
*(ptr)=']';
ptrl-=1;
char* s1 = strstr(ptrl,"</a");
@@ -334,7 +334,7 @@ char* html_to_bbcodes(char *src) {
ptr=s1;
ptr=strip_tag_within(begin,ptr);
- memmove(ptr+2, ptr, strlen(ptr) + 1);
+ memmove(ptr+2, ptr, mir_strlen(ptr) + 1);
memcpy(ptr,"[/url]",6);
}
else if (s2&&s2<s1||s2&&!s1)
@@ -342,20 +342,20 @@ char* html_to_bbcodes(char *src) ptr=s2;
ptr=strip_tag_within(begin,ptr);
int addr=ptr-rptr;
- dest=(char*)mir_realloc(dest,strlen(dest)+8);
+ dest=(char*)mir_realloc(dest,mir_strlen(dest)+8);
rptr=dest;
ptr=rptr+addr;
- memmove(ptr+6, ptr, strlen(ptr) + 1);
+ memmove(ptr+6, ptr, mir_strlen(ptr) + 1);
memcpy(ptr,"[/url]",6);
}
else
{
- strip_tag_within(begin,&dest[strlen(dest)]);
+ strip_tag_within(begin,&dest[mir_strlen(dest)]);
//int addr=ptr-rptr;
- dest=(char*)mir_realloc(dest,strlen(dest)+8);
+ dest=(char*)mir_realloc(dest,mir_strlen(dest)+8);
rptr=dest;
ptr=dest;
- memcpy(&ptr[strlen(ptr)],"[/url]",7);
+ memcpy(&ptr[mir_strlen(ptr)],"[/url]",7);
}
}
else
@@ -365,15 +365,15 @@ char* html_to_bbcodes(char *src) while (ptr = strstr(rptr, "<FONT COLOR=\""))
{
int addr=ptr-rptr;
- dest=(char*)mir_realloc(dest,strlen(dest)+8);
+ dest=(char*)mir_realloc(dest,mir_strlen(dest)+8);
rptr=dest;
ptr=rptr+addr;
ptrl = ptr + 6;
memcpy(ptrl,"[color=",7);
- memmove(ptr, ptrl, strlen(ptrl) + 1);
+ memmove(ptr, ptrl, mir_strlen(ptrl) + 1);
if ((ptr = strstr(ptrl, ">")))
{
- memmove(ptrl+7,ptr,strlen(ptr)+1);
+ memmove(ptrl+7,ptr,mir_strlen(ptr)+1);
*(ptrl+7)=']';
ptr=ptrl+7;
char* s1 = strstr(ptr,"</FONT");
@@ -381,19 +381,19 @@ char* html_to_bbcodes(char *src) if (s1&&s1<s2||s1&&!s2)
{
ptr=s1;
- memmove(ptr+1, ptr, strlen(ptr) + 1);
+ memmove(ptr+1, ptr, mir_strlen(ptr) + 1);
memcpy(ptr,"[/color]",8);
}
else if (s2&&s2<s1||s2&&!s1)
{
ptr=s2;
- memmove(ptr+8, ptr, strlen(ptr) + 1);
+ memmove(ptr+8, ptr, mir_strlen(ptr) + 1);
memcpy(ptr,"[/color]",8);
}
else
{
ptr=dest;
- memcpy(&ptr[strlen(ptr)],"[/color]",9);
+ memcpy(&ptr[mir_strlen(ptr)],"[/color]",9);
}
}
else
@@ -403,15 +403,15 @@ char* html_to_bbcodes(char *src) while (ptr = strstr(rptr, "<font color=\""))
{
int addr=ptr-rptr;
- dest=(char*)mir_realloc(dest,strlen(dest)+8);
+ dest=(char*)mir_realloc(dest,mir_strlen(dest)+8);
rptr=dest;
ptr=rptr+addr;
ptrl = ptr + 6;
memcpy(ptrl,"[color=",7);
- memmove(ptr, ptrl, strlen(ptrl) + 1);
+ memmove(ptr, ptrl, mir_strlen(ptrl) + 1);
if ((ptr = strstr(ptrl, ">")))
{
- memmove(ptrl+7,ptr,strlen(ptr)+1);
+ memmove(ptrl+7,ptr,mir_strlen(ptr)+1);
*(ptrl+7)=']';
ptr=ptrl+7;
char* s1 = strstr(ptr,"</font");
@@ -419,19 +419,19 @@ char* html_to_bbcodes(char *src) if (s1&&s1<s2||s1&&!s2)
{
ptr=s1;
- memmove(ptr+1, ptr, strlen(ptr) + 1);
+ memmove(ptr+1, ptr, mir_strlen(ptr) + 1);
memcpy(ptr,"[/color]",8);
}
else if (s2&&s2<s1||s2&&!s1)
{
ptr=s2;
- memmove(ptr+8, ptr, strlen(ptr) + 1);
+ memmove(ptr+8, ptr, mir_strlen(ptr) + 1);
memcpy(ptr,"[/color]",8);
}
else
{
ptr=dest;
- memcpy(&ptr[strlen(ptr)],"[/color]",9);
+ memcpy(&ptr[mir_strlen(ptr)],"[/color]",9);
}
}
else
@@ -441,23 +441,23 @@ char* html_to_bbcodes(char *src) while ((ptr = strstr(rptr, "<FONT COLOR=")) || (ptr = strstr(rptr, "<font color=")))
{
int addr=ptr-rptr;
- dest=(char*)mir_realloc(dest,strlen(dest)+8);
+ dest=(char*)mir_realloc(dest,mir_strlen(dest)+8);
rptr=dest;
ptr=rptr+addr;
ptrl = ptr + 5;
memcpy(ptrl,"[color=",7);
- memmove(ptr, ptrl, strlen(ptrl) + 1);
+ memmove(ptr, ptrl, mir_strlen(ptrl) + 1);
if ((ptr = strstr(ptrl, ">")))
{
*(ptr)=']';
if ((ptrl = strstr(ptr, "</FONT")) || (ptrl = strstr(ptr, "</font")))
{
- memmove(ptrl+1, ptrl, strlen(ptrl) + 1);
+ memmove(ptrl+1, ptrl, mir_strlen(ptrl) + 1);
memcpy(ptrl,"[/color]",8);
}
else
{
- memcpy(&dest[strlen(dest)],"[/color]",9);
+ memcpy(&dest[mir_strlen(dest)],"[/color]",9);
}
}
else
@@ -470,12 +470,12 @@ char* html_to_bbcodes(char *src) int addr=ptr-rptr;
int len=0;
for (len
- dest=(char*)mir_realloc(dest,strlen(dest)+8);
+ dest=(char*)mir_realloc(dest,mir_strlen(dest)+8);
rptr=dest;
ptr=rptr+addr;
ptrl = ptr + 5;
memcpy(ptrl,"[url=",7);
- memmove(ptr, ptrl, strlen(ptrl) + 1);
+ memmove(ptr, ptrl, mir_strlen(ptrl) + 1);
}
*/
return dest;
@@ -538,10 +538,10 @@ char* bbcodes_to_html(const char *src) while ((ptr = strstr(rptr, "[color=")))
{
int addr=ptr-rptr;
- dest=(char*)mir_realloc(dest,strlen(dest)+8);
+ dest=(char*)mir_realloc(dest,mir_strlen(dest)+8);
rptr=dest;
ptr=rptr+addr;
- memmove(ptr+5, ptr, strlen(ptr) + 1);
+ memmove(ptr+5, ptr, mir_strlen(ptr) + 1);
memcpy(ptr,"<font ",6);
if ((ptr = strstr(ptr,"]")))
{
@@ -549,7 +549,7 @@ char* bbcodes_to_html(const char *src) if ((ptr = strstr(ptr,"[/color]")))
{
memcpy(ptr,"</font>",7);
- memmove(ptr+7,ptr+8,strlen(ptr+8)+1);
+ memmove(ptr+7,ptr+8,mir_strlen(ptr+8)+1);
}
}
else
@@ -558,10 +558,10 @@ char* bbcodes_to_html(const char *src) while ((ptr = strstr(rptr, "[url=")))
{
int addr=ptr-rptr;
- dest=(char*)mir_realloc(dest,strlen(dest)+8);
+ dest=(char*)mir_realloc(dest,mir_strlen(dest)+8);
rptr=dest;
ptr=rptr+addr;
- memmove(ptr+3, ptr, strlen(ptr)+1);
+ memmove(ptr+3, ptr, mir_strlen(ptr)+1);
memcpy(ptr,"<a href",7);
if ((ptr = strstr(ptr, "]")))
{
@@ -569,7 +569,7 @@ char* bbcodes_to_html(const char *src) if ((ptr = strstr(ptr, "[/url]")))
{
memcpy(ptr,"</a>",4);
- memmove(ptr+4,ptr+6,strlen(ptr+6)+1);
+ memmove(ptr+4,ptr+6,mir_strlen(ptr+6)+1);
}
}
else
@@ -580,7 +580,7 @@ char* bbcodes_to_html(const char *src) void strip_tag(char* begin, char* end)
{
- memmove(begin,end+1,strlen(end+1)+1);
+ memmove(begin,end+1,mir_strlen(end+1)+1);
}
//strip a tag within a string
@@ -719,7 +719,7 @@ char* rtf_to_html(HWND hwndDlg,int DlgItem) strcpy(&buf[pos]," face=\"");
pos+=7;
strcpy(&buf[pos],Face);
- pos+=strlen(Face);
+ pos+=mir_strlen(Face);
strcpy(&buf[pos],"\"");
pos++;
if (!(cfOld.dwEffects & CFE_AUTOBACKCOLOR))
@@ -728,7 +728,7 @@ char* rtf_to_html(HWND hwndDlg,int DlgItem) pos+=6;
char chBackColor[7];
_itoa((_htonl(BackColor)>>8),chBackColor,16);
- size_t len=strlen(chBackColor);
+ size_t len=mir_strlen(chBackColor);
if (len<6)
{
memmove(chBackColor+(6-len),chBackColor,len+1);
@@ -744,7 +744,7 @@ char* rtf_to_html(HWND hwndDlg,int DlgItem) pos+=8;
char chColor[7];
_itoa((_htonl(Color)>>8),chColor,16);
- size_t len=strlen(chColor);
+ size_t len=mir_strlen(chColor);
if (len<6)
{
memmove(chColor+(6-len),chColor,len+1);
@@ -773,7 +773,7 @@ char* rtf_to_html(HWND hwndDlg,int DlgItem) {
char* txt = mir_utf8encodeT(text);
strcpy(&buf[pos], txt);
- pos += strlen(txt);
+ pos += mir_strlen(txt);
mir_free(txt);
}
start++;
@@ -832,7 +832,7 @@ void string_to_bytes(char* string, char* bytes) {
char sbyte[3];
sbyte[2]='\0';
- size_t length=strlen(string);
+ size_t length=mir_strlen(string);
for (size_t i=0; i<length; i+=2)
{
sbyte[0]=string[i];
@@ -894,7 +894,7 @@ aimString::aimString(char* str) else
{
szString = mir_utf8decodeA(str);
- size = strlen(szString);
+ size = mir_strlen(szString);
}
}
}
diff --git a/protocols/AimOscar/src/file.cpp b/protocols/AimOscar/src/file.cpp index 300561e408..b8eb1840f0 100644 --- a/protocols/AimOscar/src/file.cpp +++ b/protocols/AimOscar/src/file.cpp @@ -123,7 +123,7 @@ bool setup_next_file_send(file_transfer *ft) char* fname = mir_utf8encodeT(file);
if (ft->pfts.totalFiles > 1 && ft->file[0])
{
- size_t dlen = strlen(ft->file);
+ size_t dlen = mir_strlen(ft->file);
if (strncmp(fname, ft->file, dlen) == 0 && fname[dlen] == '\\')
{
fnamea = &fname[dlen+1];
diff --git a/protocols/AimOscar/src/proto.cpp b/protocols/AimOscar/src/proto.cpp index b3b404cced..d68cf33608 100644 --- a/protocols/AimOscar/src/proto.cpp +++ b/protocols/AimOscar/src/proto.cpp @@ -162,8 +162,8 @@ HANDLE __cdecl CAimProto::FileAllow(MCONTACT, HANDLE hTransfer, const PROTOCHAR* if (ft->pfts.totalFiles > 1 && ft->file[0])
{
- size_t path_len = strlen(path);
- size_t len = strlen(ft->file) + 2;
+ size_t path_len = mir_strlen(path);
+ size_t len = mir_strlen(ft->file) + 2;
path = (char*)mir_realloc(path, path_len + len);
mir_snprintf(&path[path_len], len, "%s\\", ft->file);
@@ -305,7 +305,7 @@ void __cdecl CAimProto::basic_search_ack_success(void* p) char *sn = normalize_name((char*)p);
if (sn) // normalize it
{
- if (strlen(sn) > 32)
+ if (mir_strlen(sn) > 32)
{
ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE) 1, 0);
}
diff --git a/protocols/AimOscar/src/proxy.cpp b/protocols/AimOscar/src/proxy.cpp index 7cfaa76e19..3ed34d54af 100644 --- a/protocols/AimOscar/src/proxy.cpp +++ b/protocols/AimOscar/src/proxy.cpp @@ -137,7 +137,7 @@ void __cdecl CAimProto::aim_proxy_helper(void* param) int proxy_initialize_send(HANDLE connection, char* sn, char* cookie)
{
- const char sn_length = (char)strlen(sn);
+ const char sn_length = (char)mir_strlen(sn);
const int len = sn_length + 21 + TLV_HEADER_SIZE + AIM_CAPS_LENGTH;
char* buf= (char*)alloca(len);
@@ -155,7 +155,7 @@ int proxy_initialize_send(HANDLE connection, char* sn, char* cookie) int proxy_initialize_recv(HANDLE connection,char* sn, char* cookie,unsigned short port_check)
{
- const char sn_length = (char)strlen(sn);
+ const char sn_length = (char)mir_strlen(sn);
const int len = sn_length + 23 + TLV_HEADER_SIZE + AIM_CAPS_LENGTH;
char* buf= (char*)alloca(len);
diff --git a/protocols/AimOscar/src/server.cpp b/protocols/AimOscar/src/server.cpp index 672beff746..3ae332dc39 100644 --- a/protocols/AimOscar/src/server.cpp +++ b/protocols/AimOscar/src/server.cpp @@ -1265,7 +1265,7 @@ void CAimProto::snac_received_message(SNAC &snac,HANDLE hServerConn,unsigned sho if (channel == 1) { //Message not file
if (auto_response) { //this message must be an autoresponse
char* away = mir_utf8encodeT(TranslateT("[Auto-Response]:"));
- size_t len = strlen(msg_buf) + strlen(away) + 2;
+ size_t len = mir_strlen(msg_buf) + mir_strlen(away) + 2;
char* buf = (char*)mir_alloc(len);
mir_snprintf(buf, len, "%s %s", away, msg_buf);
mir_free(away);
@@ -1292,7 +1292,7 @@ void CAimProto::snac_received_message(SNAC &snac,HANDLE hServerConn,unsigned sho char* s_msg = process_status_msg(*msgptr, sn);
char* away = mir_utf8encodeT(TranslateT("[Auto-Response]:"));
- size_t len = strlen(s_msg) + strlen(away) + 2;
+ size_t len = mir_strlen(s_msg) + mir_strlen(away) + 2;
char* buf = (char*)alloca(len);
mir_snprintf(buf, len, "%s %s", away, s_msg);
mir_free(away);
diff --git a/protocols/AimOscar/src/ui.cpp b/protocols/AimOscar/src/ui.cpp index bef02edf15..a01c6e54d7 100644 --- a/protocols/AimOscar/src/ui.cpp +++ b/protocols/AimOscar/src/ui.cpp @@ -624,7 +624,7 @@ static INT_PTR CALLBACK userinfo_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, L cf.dwEffects=0;
char chsize[5] = "";
SendDlgItemMessage(hwndDlg, IDC_FONTSIZE, CB_GETLBTEXT, SendDlgItemMessage(hwndDlg, IDC_FONTSIZE, CB_GETCURSEL, 0, 0),(LPARAM)chsize);
- //strlcpy(cf.szFaceName,size,strlen(size)+1);
+ //strlcpy(cf.szFaceName,size,mir_strlen(size)+1);
cf.yHeight=atoi(chsize)*20;
SendDlgItemMessage(hwndDlg, IDC_PROFILE, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf);
SetFocus(GetDlgItem(hwndDlg, IDC_PROFILE));
@@ -692,7 +692,7 @@ INT_PTR CALLBACK admin_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar char name[64];
GetDlgItemTextA(hwndDlg, IDC_FNAME, name, SIZEOF(name));
- if (strlen(trim_str(name)) > 0 && !ppro->getString(AIM_KEY_SN, &dbv))
+ if (mir_strlen(trim_str(name)) > 0 && !ppro->getString(AIM_KEY_SN, &dbv))
{
if (strcmp(name, dbv.pszVal))
ppro->aim_admin_format_name(ppro->hAdminConn,ppro->admin_seqno,name);
@@ -701,7 +701,7 @@ INT_PTR CALLBACK admin_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar char email[254];
GetDlgItemTextA(hwndDlg, IDC_CEMAIL, email, SIZEOF(email));
- if (strlen(trim_str(email)) > 1 && !ppro->getString(AIM_KEY_EM, &dbv)) // Must be greater than 1 or a SNAC error is thrown.
+ if (mir_strlen(trim_str(email)) > 1 && !ppro->getString(AIM_KEY_EM, &dbv)) // Must be greater than 1 or a SNAC error is thrown.
{
if (strcmp(email, dbv.pszVal))
ppro->aim_admin_change_email(ppro->hAdminConn,ppro->admin_seqno,email);
diff --git a/protocols/AimOscar/src/utility.cpp b/protocols/AimOscar/src/utility.cpp index 67a9e26c69..ea7dafe878 100644 --- a/protocols/AimOscar/src/utility.cpp +++ b/protocols/AimOscar/src/utility.cpp @@ -346,7 +346,7 @@ char *normalize_name(const char *s) char* trim_str(char* s)
{
if (s == NULL) return NULL;
- size_t len = strlen(s);
+ size_t len = mir_strlen(s);
while (len)
{
@@ -357,7 +357,7 @@ char* trim_str(char* s) char* sc = s;
while (isspace(*sc)) ++sc;
- memcpy(s,sc,strlen(sc)+1);
+ memcpy(s,sc,mir_strlen(sc)+1);
return s;
}
@@ -568,9 +568,9 @@ void CAimProto::write_away_message(const char* sn, const char* msg, bool utf) if (utf) _write(fid, "\xEF\xBB\xBF", 3);
char* s_msg=process_status_msg(msg, sn);
_write(fid, "<h3>", 4);
- _write(fid, sn, (unsigned)strlen(sn));
+ _write(fid, sn, (unsigned)mir_strlen(sn));
_write(fid, "'s Away Message:</h3>", 21);
- _write(fid, s_msg, (unsigned)strlen(s_msg));
+ _write(fid, s_msg, (unsigned)mir_strlen(s_msg));
_close(fid);
ShellExecute(NULL, _T("open"), path, NULL, NULL, SW_SHOW);
mir_free(path);
@@ -587,9 +587,9 @@ void CAimProto::write_profile(const char* sn, const char* msg, bool utf) if (utf) _write(fid, "\xEF\xBB\xBF", 3);
char* s_msg=process_status_msg(msg, sn);
_write(fid, "<h3>", 4);
- _write(fid, sn, (unsigned)strlen(sn));
+ _write(fid, sn, (unsigned)mir_strlen(sn));
_write(fid, "'s Profile:</h3>", 16);
- _write(fid, s_msg, (unsigned)strlen(s_msg));
+ _write(fid, s_msg, (unsigned)mir_strlen(s_msg));
_close(fid);
ShellExecute(NULL, _T("open"), path, NULL, NULL, SW_SHOW);
mir_free(path);
@@ -646,7 +646,7 @@ char* long_ip_to_char_ip(unsigned long host, char* ip) {
char store[16];
_itoa(bytes[i], store, 10);
- size_t len = strlen(store);
+ size_t len = mir_strlen(store);
memcpy(&ip[buf_loc], store, len);
buf_loc += len;
diff --git a/protocols/EmLanProto/src/mlan.cpp b/protocols/EmLanProto/src/mlan.cpp index ea863ab9ea..fe13fa4aaf 100644 --- a/protocols/EmLanProto/src/mlan.cpp +++ b/protocols/EmLanProto/src/mlan.cpp @@ -282,7 +282,7 @@ void CMLan::OnRecvPacket(u_char* mes, int len, in_addr from) cont->m_addr = from; cont->m_prev = m_pRootContact; cont->m_status = ID_STATUS_OFFLINE; - int nlen = (int)strlen(pak.strName); + int nlen = (int)mir_strlen(pak.strName); cont->m_nick = new char[nlen + 1]; memcpy(cont->m_nick, pak.strName, nlen + 1); m_pRootContact = cont; @@ -292,7 +292,7 @@ void CMLan::OnRecvPacket(u_char* mes, int len, in_addr from) if (pak.strName && strcmp(pak.strName, cont->m_nick) != 0) { delete[] cont->m_nick; - int nlen = (int)strlen(pak.strName); + int nlen = (int)mir_strlen(pak.strName); cont->m_nick = new char[nlen + 1]; memcpy(cont->m_nick, pak.strName, nlen + 1); } @@ -1063,14 +1063,14 @@ void CMLan::RecvFile(CCSDATA* ccs) db_unset(ccs->hContact, "CList", "Hidden"); szFile = pre->szMessage + sizeof(DWORD); - szDesc = szFile + strlen(szFile) + 1; + szDesc = szFile + mir_strlen(szFile) + 1; DBEVENTINFO dbei = { sizeof(dbei) }; dbei.szModule = PROTONAME; dbei.timestamp = pre->timestamp; dbei.flags = pre->flags & (PREF_CREATEREAD ? DBEF_READ : 0); dbei.eventType = EVENTTYPE_FILE; - dbei.cbBlob = DWORD(sizeof(DWORD) + strlen(szFile) + strlen(szDesc) + 2); + dbei.cbBlob = DWORD(sizeof(DWORD) + mir_strlen(szFile) + mir_strlen(szDesc) + 2); dbei.pBlob = (PBYTE)pre->szMessage; db_event_add(ccs->hContact, &dbei); } @@ -1395,12 +1395,12 @@ void CMLan::OnOutTCPConnection(u_long addr, SOCKET out_socket, LPVOID lpParamete delete[] * pf; *pf = _strdup(name); strcpy((char*)buf + len, filepart); - len += (int)strlen(filepart) + 1; + len += (int)mir_strlen(filepart) + 1; pf++; } strcpy((char*)buf + len, conn->m_szDescription); - len += (int)strlen(conn->m_szDescription) + 1; + len += (int)mir_strlen(conn->m_szDescription) + 1; *((int*)(buf + 1)) = size; *((int*)(buf + 1 + 4)) = filecount; diff --git a/protocols/FacebookRM/src/connection.cpp b/protocols/FacebookRM/src/connection.cpp index 01e63d6ff9..57070cd827 100644 --- a/protocols/FacebookRM/src/connection.cpp +++ b/protocols/FacebookRM/src/connection.cpp @@ -171,7 +171,7 @@ bool FacebookProto::NegotiateConnection() debugLogA("*** Negotiating connection with Facebook"); ptrA username(getStringA(FACEBOOK_KEY_LOGIN)); - if (!username || !strlen(username)) { + if (!username || !mir_strlen(username)) { NotifyEvent(m_tszUserName, TranslateT("Please enter a username."), NULL, FACEBOOK_EVENT_CLIENT); return false; } diff --git a/protocols/FacebookRM/src/proto.cpp b/protocols/FacebookRM/src/proto.cpp index 2b8fba99de..a8a65bc88a 100644 --- a/protocols/FacebookRM/src/proto.cpp +++ b/protocols/FacebookRM/src/proto.cpp @@ -880,7 +880,7 @@ std::string FacebookProto::PrepareUrl(std::string url) { // Make realtive url if (!isRelativeUrl) { - url = url.substr(pos + strlen(FACEBOOK_SERVER_DOMAIN)); + url = url.substr(pos + mir_strlen(FACEBOOK_SERVER_DOMAIN)); // Strip eventual port pos = url.find("/"); @@ -1057,7 +1057,7 @@ void FacebookProto::InitHotkeys() { char text[200]; mir_strncpy(text, m_szModuleName, 100); - char *tDest = text + strlen(text); + char *tDest = text + mir_strlen(text); HOTKEYDESC hkd = { sizeof(hkd) }; hkd.pszName = text; diff --git a/protocols/FacebookRM/src/theme.cpp b/protocols/FacebookRM/src/theme.cpp index d95a16b40c..bf3e953cc3 100644 --- a/protocols/FacebookRM/src/theme.cpp +++ b/protocols/FacebookRM/src/theme.cpp @@ -210,7 +210,7 @@ int FacebookProto::OnBuildStatusMenu(WPARAM, LPARAM) {
char text[200];
mir_strncpy(text, m_szModuleName, 100);
- char *tDest = text + strlen(text);
+ char *tDest = text + mir_strlen(text);
CLISTMENUITEM mi = { sizeof(mi) };
mi.pszService = text;
diff --git a/protocols/FacebookRM/src/utils.cpp b/protocols/FacebookRM/src/utils.cpp index 2267f0cce9..d1f290f6d1 100644 --- a/protocols/FacebookRM/src/utils.cpp +++ b/protocols/FacebookRM/src/utils.cpp @@ -403,7 +403,7 @@ std::string utils::text::source_get_value2(std::string* data, const char *term, start = data->find(term);
if (start != std::string::npos) {
- start += strlen(term);
+ start += mir_strlen(term);
end = data->find_first_of(endings, start);
if (end != std::string::npos) {
@@ -478,7 +478,7 @@ std::string utils::text::rand_string(int len, const char *chars, unsigned int *n {
std::stringstream out;
- int strLen = (int)strlen(chars);
+ int strLen = (int)mir_strlen(chars);
for (int i = 0; i < len; ++i) {
out << chars[utils::number::random(0, strLen, number)];
}
diff --git a/protocols/GTalkExt/src/inbox.cpp b/protocols/GTalkExt/src/inbox.cpp index 5fa07c9bed..8db7427a0d 100644 --- a/protocols/GTalkExt/src/inbox.cpp +++ b/protocols/GTalkExt/src/inbox.cpp @@ -161,7 +161,7 @@ int GetMailboxPwd(LPCSTR acc, LPSTR *pwd, int buffSize) if (db_get_static(NULL, acc, LOGIN_PASS_SETTING_NAME, buff, sizeof(buff)))
return 0;
- int result = (int)strlen(buff);
+ int result = (int)mir_strlen(buff);
if (pwd) {
if (buffSize < result + 1)
diff --git a/protocols/Gadu-Gadu/src/avatar.cpp b/protocols/Gadu-Gadu/src/avatar.cpp index a28c471e2a..e6fcdaa74c 100644 --- a/protocols/Gadu-Gadu/src/avatar.cpp +++ b/protocols/Gadu-Gadu/src/avatar.cpp @@ -137,7 +137,7 @@ char *gg_avatarhash(char *param) return NULL;
BYTE digest[MIR_SHA1_HASH_SIZE];
- mir_sha1_hash((BYTE*)param, (int)strlen(param), digest);
+ mir_sha1_hash((BYTE*)param, (int)mir_strlen(param), digest);
return bin2hex(digest, sizeof(digest), result);
}
@@ -150,7 +150,7 @@ void GGPROTO::requestAvatarTransfer(MCONTACT hContact, char *szAvatarURL) gg_EnterCriticalSection(&avatar_mutex, "requestAvatarTransfer", 1, "avatar_mutex", 1);
if (avatar_transfers.getIndex((GGGETAVATARDATA*)&hContact) == -1) {
- GGGETAVATARDATA *data = (GGGETAVATARDATA*)mir_alloc(sizeof(GGGETAVATARDATA) + strlen(szAvatarURL)+1);
+ GGGETAVATARDATA *data = (GGGETAVATARDATA*)mir_alloc(sizeof(GGGETAVATARDATA) + mir_strlen(szAvatarURL)+1);
data->hContact = hContact;
data->szAvatarURL = strcpy((char*)(data+1), szAvatarURL);
avatar_transfers.insert(data);
@@ -388,11 +388,11 @@ void __cdecl GGPROTO::setavatarthread(void *param) mir_free(avatarFile);
ptrA avatarFileB64Enc(mir_urlEncode(avatarFileB64));
- size_t avatarFileB64EncLen = strlen(avatarFileB64Enc);
+ size_t avatarFileB64EncLen = mir_strlen(avatarFileB64Enc);
char dataPrefix[64];
mir_snprintf(dataPrefix, SIZEOF(dataPrefix), "uin=%d&photo=", getDword(GG_KEY_UIN, 0));
- size_t dataPrefixLen = strlen(dataPrefix);
+ size_t dataPrefixLen = mir_strlen(dataPrefix);
size_t dataLen = dataPrefixLen + avatarFileB64EncLen;
char* data = (char*)mir_alloc(dataLen);
diff --git a/protocols/Gadu-Gadu/src/core.cpp b/protocols/Gadu-Gadu/src/core.cpp index 01452e7a5f..cfbb68266d 100644 --- a/protocols/Gadu-Gadu/src/core.cpp +++ b/protocols/Gadu-Gadu/src/core.cpp @@ -922,7 +922,7 @@ retry: dbei.timestamp = (DWORD)e->event.multilogon_msg.time;
dbei.flags = DBEF_SENT | DBEF_UTF;
dbei.eventType = EVENTTYPE_MESSAGE;
- dbei.cbBlob = (DWORD)strlen(e->event.multilogon_msg.message) + 1;
+ dbei.cbBlob = (DWORD)mir_strlen(e->event.multilogon_msg.message) + 1;
dbei.pBlob = (PBYTE)e->event.multilogon_msg.message;
db_event_add( getcontact(e->event.multilogon_msg.sender, 1, 0, NULL), &dbei);
}
diff --git a/protocols/Gadu-Gadu/src/dialogs.cpp b/protocols/Gadu-Gadu/src/dialogs.cpp index 88d5a1cd30..82a635c024 100644 --- a/protocols/Gadu-Gadu/src/dialogs.cpp +++ b/protocols/Gadu-Gadu/src/dialogs.cpp @@ -194,7 +194,7 @@ void GGPROTO::checknewuser(uin_t uin, const char* passwd) db_free(&dbv); } - if (uin > 0 && strlen(passwd) > 0 && (uin != olduin || strcmp(oldpasswd, passwd))) + if (uin > 0 && mir_strlen(passwd) > 0 && (uin != olduin || strcmp(oldpasswd, passwd))) check_first_conn = 1; } @@ -340,7 +340,7 @@ static INT_PTR CALLBACK gg_genoptsdlgproc(HWND hwndDlg, UINT msg, WPARAM wParam, GetDlgItemTextA(hwndDlg, IDC_UIN, email, SIZEOF(email)); uin = atoi(email); GetDlgItemTextA(hwndDlg, IDC_EMAIL, email, SIZEOF(email)); - if (!strlen(email)) + if (!mir_strlen(email)) MessageBox(NULL, TranslateT("You need to specify your registration e-mail first."), gg->m_tszUserName, MB_OK | MB_ICONEXCLAMATION); else if (MessageBox(NULL, diff --git a/protocols/Gadu-Gadu/src/dynstuff.cpp b/protocols/Gadu-Gadu/src/dynstuff.cpp index 9ae41daf59..17ce53a534 100644 --- a/protocols/Gadu-Gadu/src/dynstuff.cpp +++ b/protocols/Gadu-Gadu/src/dynstuff.cpp @@ -242,7 +242,7 @@ int string_append_n(string_t s, const char *str, int count) }
if (count == -1)
- count = (int)strlen(str);
+ count = (int)mir_strlen(str);
string_realloc(s, s->len + count);
@@ -275,7 +275,7 @@ void string_insert_n(string_t s, int index, const char *str, int count) return;
if (count == -1)
- count = (int)strlen(str);
+ count = (int)mir_strlen(str);
if (index > s->len)
index = s->len;
@@ -310,8 +310,8 @@ string_t string_init(const char *value) value = "";
tmp->str = _strdup(value);
- tmp->len = (int)strlen(value);
- tmp->size = (int)strlen(value) + 1;
+ tmp->len = (int)mir_strlen(value);
+ tmp->size = (int)mir_strlen(value) + 1;
return tmp;
}
diff --git a/protocols/Gadu-Gadu/src/filetransfer.cpp b/protocols/Gadu-Gadu/src/filetransfer.cpp index 162c57f27c..7cf7f5f319 100644 --- a/protocols/Gadu-Gadu/src/filetransfer.cpp +++ b/protocols/Gadu-Gadu/src/filetransfer.cpp @@ -270,7 +270,7 @@ void __cdecl GGPROTO::dccmainthread(void*) PROTOFILETRANSFERSTATUS pfts;
local_dcc->tick = tick;
strncpy(filename, local_dcc->folder, sizeof(filename));
- strncat(filename, (char*)local_dcc->file_info.filename, sizeof(filename) - strlen(filename));
+ strncat(filename, (char*)local_dcc->file_info.filename, sizeof(filename) - mir_strlen(filename));
memset(&pfts, 0, sizeof(PROTOFILETRANSFERSTATUS));
pfts.cbSize = sizeof(PROTOFILETRANSFERSTATUS);
pfts.hContact = (MCONTACT)local_dcc->contact;
@@ -301,7 +301,7 @@ void __cdecl GGPROTO::dccmainthread(void*) {
PROTOFILETRANSFERSTATUS pfts;
strncpy(filename, local_dcc->folder, sizeof(filename));
- strncat(filename, (char*)local_dcc->file_info.filename, sizeof(filename) - strlen(filename));
+ strncat(filename, (char*)local_dcc->file_info.filename, sizeof(filename) - mir_strlen(filename));
memset(&pfts, 0, sizeof(PROTOFILETRANSFERSTATUS));
pfts.cbSize = sizeof(PROTOFILETRANSFERSTATUS);
pfts.hContact = (MCONTACT)local_dcc->contact;
@@ -500,7 +500,7 @@ void __cdecl GGPROTO::dccmainthread(void*) PROTOFILETRANSFERSTATUS pfts;
local_dcc7->tick = tick;
strncpy(filename, local_dcc7->folder, sizeof(filename));
- strncat(filename, (char*)local_dcc7->filename, sizeof(filename) - strlen(filename));
+ strncat(filename, (char*)local_dcc7->filename, sizeof(filename) - mir_strlen(filename));
memset(&pfts, 0, sizeof(PROTOFILETRANSFERSTATUS));
pfts.cbSize = sizeof(PROTOFILETRANSFERSTATUS);
pfts.hContact = (MCONTACT)local_dcc7->contact;
@@ -531,7 +531,7 @@ void __cdecl GGPROTO::dccmainthread(void*) {
PROTOFILETRANSFERSTATUS pfts;
strncpy(filename, local_dcc7->folder, sizeof(filename));
- strncat(filename, (char*)local_dcc7->filename, sizeof(filename) - strlen(filename));
+ strncat(filename, (char*)local_dcc7->filename, sizeof(filename) - mir_strlen(filename));
memset(&pfts, 0, sizeof(PROTOFILETRANSFERSTATUS));
pfts.cbSize = sizeof(PROTOFILETRANSFERSTATUS);
pfts.hContact = (MCONTACT)local_dcc7->contact;
@@ -667,7 +667,7 @@ HANDLE GGPROTO::dccfileallow(HANDLE hTransfer, const PROTOCHAR* szPath) struct gg_dcc *dcc = (struct gg_dcc *) hTransfer;
char fileName[MAX_PATH], *path = mir_t2a(szPath);
strncpy(fileName, path, sizeof(fileName));
- strncat(fileName, (char*)dcc->file_info.filename, sizeof(fileName) - strlen(fileName));
+ strncat(fileName, (char*)dcc->file_info.filename, sizeof(fileName) - mir_strlen(fileName));
dcc->folder = _strdup((char *) path);
dcc->tick = 0;
mir_free(path);
@@ -709,7 +709,7 @@ HANDLE GGPROTO::dcc7fileallow(HANDLE hTransfer, const PROTOCHAR* szPath) char fileName[MAX_PATH], *path = mir_t2a(szPath);
int iFtRemoveRes;
strncpy(fileName, path, sizeof(fileName));
- strncat(fileName, (char*)dcc7->filename, sizeof(fileName) - strlen(fileName));
+ strncat(fileName, (char*)dcc7->filename, sizeof(fileName) - mir_strlen(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 71f53ce6a7..9a79056216 100644 --- a/protocols/Gadu-Gadu/src/gg.cpp +++ b/protocols/Gadu-Gadu/src/gg.cpp @@ -440,11 +440,11 @@ void gg_debughandler(int level, const char *format, va_list ap) char prefix[6];
mir_snprintf(prefix, SIZEOF(prefix), "%lu", GetCurrentThreadId());
- size_t prefixLen = strlen(prefix);
+ size_t prefixLen = mir_strlen(prefix);
if (prefixLen < PREFIXLEN) memset(prefix + prefixLen, ' ', PREFIXLEN - prefixLen);
memcpy(szText, prefix, PREFIXLEN);
- mir_vsnprintf(szText + strlen(szText), sizeof(szText) - strlen(szText), szFormat, ap);
+ mir_vsnprintf(szText + mir_strlen(szText), sizeof(szText) - mir_strlen(szText), szFormat, ap);
CallService(MS_NETLIB_LOG, NULL, (LPARAM)szText);
free(szFormat);
}
diff --git a/protocols/Gadu-Gadu/src/gg_proto.cpp b/protocols/Gadu-Gadu/src/gg_proto.cpp index 7d497c7033..bb8facc711 100644 --- a/protocols/Gadu-Gadu/src/gg_proto.cpp +++ b/protocols/Gadu-Gadu/src/gg_proto.cpp @@ -332,28 +332,28 @@ HANDLE GGPROTO::SearchByName(const PROTOCHAR *nick, const PROTOCHAR *firstName, {
char *nick_utf8 = mir_utf8encodeT(nick);
gg_pubdir50_add(req, GG_PUBDIR50_NICKNAME, nick_utf8);
- strncat(data, nick_utf8, sizeof(data) - strlen(data));
+ strncat(data, nick_utf8, sizeof(data) - mir_strlen(data));
mir_free(nick_utf8);
}
- strncat(data, ".", sizeof(data) - strlen(data));
+ strncat(data, ".", sizeof(data) - mir_strlen(data));
if (firstName)
{
char *firstName_utf8 = mir_utf8encodeT(firstName);
gg_pubdir50_add(req, GG_PUBDIR50_FIRSTNAME, firstName_utf8);
- strncat(data, firstName_utf8, sizeof(data) - strlen(data));
+ strncat(data, firstName_utf8, sizeof(data) - mir_strlen(data));
mir_free(firstName_utf8);
}
- strncat(data, ".", sizeof(data) - strlen(data));
+ strncat(data, ".", sizeof(data) - mir_strlen(data));
if (lastName)
{
char *lastName_utf8 = mir_utf8encodeT(lastName);
gg_pubdir50_add(req, GG_PUBDIR50_LASTNAME, lastName_utf8);
- strncat(data, lastName_utf8, sizeof(data) - strlen(data));
+ strncat(data, lastName_utf8, sizeof(data) - mir_strlen(data));
mir_free(lastName_utf8);
}
- strncat(data, ".", sizeof(data) - strlen(data));
+ strncat(data, ".", sizeof(data) - mir_strlen(data));
// Count crc & check if the data was equal if yes do same search with shift
crc = crc_get(data);
@@ -409,40 +409,40 @@ HWND GGPROTO::SearchAdvanced(HWND hwndDlg) {
char *firstName_utf8 = mir_utf8encodeT(text);
gg_pubdir50_add(req, GG_PUBDIR50_FIRSTNAME, firstName_utf8);
- strncat(data, firstName_utf8, sizeof(data) - strlen(data));
+ strncat(data, firstName_utf8, sizeof(data) - mir_strlen(data));
mir_free(firstName_utf8);
}
- /* 1 */ strncat(data, ".", sizeof(data) - strlen(data));
+ /* 1 */ strncat(data, ".", sizeof(data) - mir_strlen(data));
GetDlgItemText(hwndDlg, IDC_LASTNAME, text, SIZEOF(text));
if (_tcslen(text))
{
char *lastName_utf8 = mir_utf8encodeT(text);
gg_pubdir50_add(req, GG_PUBDIR50_LASTNAME, lastName_utf8);
- strncat(data, lastName_utf8, sizeof(data) - strlen(data));
+ strncat(data, lastName_utf8, sizeof(data) - mir_strlen(data));
mir_free(lastName_utf8);
}
- /* 2 */ strncat(data, ".", sizeof(data) - strlen(data));
+ /* 2 */ strncat(data, ".", sizeof(data) - mir_strlen(data));
GetDlgItemText(hwndDlg, IDC_NICKNAME, text, SIZEOF(text));
if (_tcslen(text))
{
char *nickName_utf8 = mir_utf8encodeT(text);
gg_pubdir50_add(req, GG_PUBDIR50_NICKNAME, nickName_utf8);
- strncat(data, nickName_utf8, sizeof(data) - strlen(data));
+ strncat(data, nickName_utf8, sizeof(data) - mir_strlen(data));
mir_free(nickName_utf8);
}
- /* 3 */ strncat(data, ".", sizeof(data) - strlen(data));
+ /* 3 */ strncat(data, ".", sizeof(data) - mir_strlen(data));
GetDlgItemText(hwndDlg, IDC_CITY, text, SIZEOF(text));
if (_tcslen(text))
{
char *city_utf8 = mir_utf8encodeT(text);
gg_pubdir50_add(req, GG_PUBDIR50_CITY, city_utf8);
- strncat(data, city_utf8, sizeof(data) - strlen(data));
+ strncat(data, city_utf8, sizeof(data) - mir_strlen(data));
mir_free(city_utf8);
}
- /* 4 */ strncat(data, ".", sizeof(data) - strlen(data));
+ /* 4 */ strncat(data, ".", sizeof(data) - mir_strlen(data));
GetDlgItemText(hwndDlg, IDC_AGEFROM, text, SIZEOF(text));
if (_tcslen(text))
@@ -470,33 +470,33 @@ HWND GGPROTO::SearchAdvanced(HWND hwndDlg) char *age_utf8 = mir_utf8encodeT(text);
gg_pubdir50_add(req, GG_PUBDIR50_BIRTHYEAR, age_utf8);
- strncat(data, age_utf8, sizeof(data) - strlen(data));
+ strncat(data, age_utf8, sizeof(data) - mir_strlen(data));
mir_free(age_utf8);
}
- /* 5 */ strncat(data, ".", sizeof(data) - strlen(data));
+ /* 5 */ strncat(data, ".", sizeof(data) - mir_strlen(data));
switch(SendDlgItemMessage(hwndDlg, IDC_GENDER, CB_GETCURSEL, 0, 0))
{
case 1:
gg_pubdir50_add(req, GG_PUBDIR50_GENDER, GG_PUBDIR50_GENDER_FEMALE);
- strncat(data, GG_PUBDIR50_GENDER_MALE, sizeof(data) - strlen(data));
+ strncat(data, GG_PUBDIR50_GENDER_MALE, sizeof(data) - mir_strlen(data));
break;
case 2:
gg_pubdir50_add(req, GG_PUBDIR50_GENDER, GG_PUBDIR50_GENDER_MALE);
- strncat(data, GG_PUBDIR50_GENDER_FEMALE, sizeof(data) - strlen(data));
+ strncat(data, GG_PUBDIR50_GENDER_FEMALE, sizeof(data) - mir_strlen(data));
break;
}
- /* 6 */ strncat(data, ".", sizeof(data) - strlen(data));
+ /* 6 */ strncat(data, ".", sizeof(data) - mir_strlen(data));
if (IsDlgButtonChecked(hwndDlg, IDC_ONLYCONNECTED))
{
gg_pubdir50_add(req, GG_PUBDIR50_ACTIVE, GG_PUBDIR50_ACTIVE_TRUE);
- strncat(data, GG_PUBDIR50_ACTIVE_TRUE, sizeof(data) - strlen(data));
+ strncat(data, GG_PUBDIR50_ACTIVE_TRUE, sizeof(data) - mir_strlen(data));
}
- /* 7 */ strncat(data, ".", sizeof(data) - strlen(data));
+ /* 7 */ strncat(data, ".", sizeof(data) - mir_strlen(data));
// No data entered
- if (strlen(data) <= 7 || (strlen(data) == 8 && IsDlgButtonChecked(hwndDlg, IDC_ONLYCONNECTED))) return (HWND)0;
+ if (mir_strlen(data) <= 7 || (mir_strlen(data) == 8 && IsDlgButtonChecked(hwndDlg, IDC_ONLYCONNECTED))) return (HWND)0;
// Count crc & check if the data was equal if yes do same search with shift
crc = crc_get(data);
diff --git a/protocols/Gadu-Gadu/src/import.cpp b/protocols/Gadu-Gadu/src/import.cpp index c39509f68a..536da7cb30 100644 --- a/protocols/Gadu-Gadu/src/import.cpp +++ b/protocols/Gadu-Gadu/src/import.cpp @@ -441,7 +441,7 @@ INT_PTR GGPROTO::export_text(WPARAM wParam, LPARAM lParam) FILE *f = _tfopen(str, _T("w"));
if (f) {
char *contacts = gg_makecontacts(this, 0);
- fwrite(contacts, sizeof(char), strlen(contacts), f);
+ fwrite(contacts, sizeof(char), mir_strlen(contacts), f);
fclose(f);
free(contacts);
diff --git a/protocols/Gadu-Gadu/src/oauth.cpp b/protocols/Gadu-Gadu/src/oauth.cpp index 79aad2fa80..5a8455422b 100644 --- a/protocols/Gadu-Gadu/src/oauth.cpp +++ b/protocols/Gadu-Gadu/src/oauth.cpp @@ -59,7 +59,7 @@ char *oauth_uri_escape(const char *str) if (str == NULL) return mir_strdup("");
- size = (int)strlen(str) + 1;
+ size = (int)mir_strlen(str) + 1;
res = (char *)mir_alloc(size);
while (*str) {
@@ -88,7 +88,7 @@ char *oauth_generate_signature(LIST<OAUTHPARAMETER> ¶ms, const char *httpmet if (httpmethod == NULL || url == NULL || !params.getCount()) return mir_strdup("");
- urlnorm = (char *)mir_alloc(strlen(url) + 1);
+ urlnorm = (char *)mir_alloc(mir_strlen(url) + 1);
while (*url) {
if (*url == '?' || *url == '#') break; // see RFC 3986 section 3
urlnorm[ix++] = tolower(*url);
@@ -96,19 +96,19 @@ char *oauth_generate_signature(LIST<OAUTHPARAMETER> ¶ms, const char *httpmet }
urlnorm[ix] = 0;
if ((res = strstr(urlnorm, ":80")) != NULL)
- memmove(res, res + 3, strlen(res) - 2);
+ memmove(res, res + 3, mir_strlen(res) - 2);
else if ((res = strstr(urlnorm, ":443")) != NULL)
- memmove(res, res + 4, strlen(res) - 3);
+ memmove(res, res + 4, mir_strlen(res) - 3);
urlenc = oauth_uri_escape(urlnorm);
mir_free(urlnorm);
- size = (int)strlen(httpmethod) + (int)strlen(urlenc) + 1 + 2;
+ size = (int)mir_strlen(httpmethod) + (int)mir_strlen(urlenc) + 1 + 2;
for (i = 0; i < params.getCount(); i++) {
p = params[i];
if (!strcmp(p->name, "oauth_signature")) continue;
if (i > 0) size += 3;
- size += (int)strlen(p->name) + (int)strlen(p->value) + 3;
+ size += (int)mir_strlen(p->name) + (int)mir_strlen(p->value) + 3;
}
res = (char *)mir_alloc(size);
@@ -194,20 +194,20 @@ int oauth_sign_request(LIST<OAUTHPARAMETER> ¶ms, const char *httpmethod, con ptrA text( oauth_generate_signature(params, httpmethod, url));
ptrA csenc( oauth_uri_escape(consumer_secret));
ptrA tsenc( oauth_uri_escape(token_secret));
- ptrA key((char *)mir_alloc(strlen(csenc) + strlen(tsenc) + 2));
+ ptrA key((char *)mir_alloc(mir_strlen(csenc) + mir_strlen(tsenc) + 2));
strcpy(key, csenc);
strcat(key, "&");
strcat(key, tsenc);
BYTE digest[MIR_SHA1_HASH_SIZE];
- mir_hmac_sha1(digest, (BYTE*)(char*)key, strlen(key), (BYTE*)(char*)text, strlen(text));
+ mir_hmac_sha1(digest, (BYTE*)(char*)key, mir_strlen(key), (BYTE*)(char*)text, mir_strlen(text));
sign = mir_base64_encode(digest, MIR_SHA1_HASH_SIZE);
}
else { // PLAINTEXT
ptrA csenc( oauth_uri_escape(consumer_secret));
ptrA tsenc( oauth_uri_escape(token_secret));
- sign = (char *)mir_alloc(strlen(csenc) + strlen(tsenc) + 2);
+ sign = (char *)mir_alloc(mir_strlen(csenc) + mir_strlen(tsenc) + 2);
strcpy(sign, csenc);
strcat(sign, "&");
strcat(sign, tsenc);
@@ -225,7 +225,7 @@ char *oauth_generate_nonce() mir_snprintf(timestamp, SIZEOF(timestamp), "%ld", time(NULL));
CallService(MS_UTILS_GETRANDOM, (WPARAM)sizeof(randnum), (LPARAM)randnum);
- int strSizeB = int(strlen(timestamp) + sizeof(randnum));
+ int strSizeB = int(mir_strlen(timestamp) + sizeof(randnum));
ptrA str((char *)mir_calloc(strSizeB + 1));
strcpy(str, timestamp);
strncat(str, randnum, sizeof(randnum));
@@ -269,7 +269,7 @@ char *oauth_auth_header(const char *httpmethod, const char *url, OAUTHSIGNMETHOD for (i = 0; i < oauth_parameters.getCount(); i++) {
OAUTHPARAMETER *p = oauth_parameters[i];
if (i > 0) size++;
- size += (int)strlen(p->name) + (int)strlen(p->value) + 3;
+ size += (int)mir_strlen(p->name) + (int)mir_strlen(p->value) + 3;
}
res = (char *)mir_alloc(size);
@@ -360,7 +360,7 @@ int GGPROTO::oauth_receivetoken() httpHeaders[1].szName = "Content-Type";
httpHeaders[1].szValue = "application/x-www-form-urlencoded";
req.pData = str;
- req.dataLength = (int)strlen(str);
+ req.dataLength = (int)mir_strlen(str);
resp = (NETLIBHTTPREQUEST *)CallService(MS_NETLIB_HTTPTRANSACTION, (WPARAM)m_hNetlibUser, (LPARAM)&req);
if (resp) CallService(MS_NETLIB_FREEHTTPREQUESTSTRUCT, 0, (LPARAM)resp);
diff --git a/protocols/Gadu-Gadu/src/ownerinfo.cpp b/protocols/Gadu-Gadu/src/ownerinfo.cpp index 25bb183156..7c8da3e1a4 100644 --- a/protocols/Gadu-Gadu/src/ownerinfo.cpp +++ b/protocols/Gadu-Gadu/src/ownerinfo.cpp @@ -37,7 +37,7 @@ void __cdecl GGPROTO::remindpasswordthread(void *param) GGTOKEN token;
debugLogA("remindpasswordthread(): Started.");
- if (!rp || !rp->email || !rp->uin || !strlen(rp->email))
+ if (!rp || !rp->email || !rp->uin || !mir_strlen(rp->email))
{
free(rp);
#ifdef DEBUGMODE
diff --git a/protocols/Gadu-Gadu/src/services.cpp b/protocols/Gadu-Gadu/src/services.cpp index 57fa852040..be57b3020f 100644 --- a/protocols/Gadu-Gadu/src/services.cpp +++ b/protocols/Gadu-Gadu/src/services.cpp @@ -43,7 +43,7 @@ char *gg_status2db(int status, const char *suffix) default: return NULL;
}
strncpy(str, prefix, sizeof(str));
- strncat(str, suffix, sizeof(str) - strlen(str));
+ strncat(str, suffix, sizeof(str) - mir_strlen(str));
return str;
}
diff --git a/protocols/Gadu-Gadu/src/userutils.cpp b/protocols/Gadu-Gadu/src/userutils.cpp index 88596aeaaf..8c47ebe3a6 100644 --- a/protocols/Gadu-Gadu/src/userutils.cpp +++ b/protocols/Gadu-Gadu/src/userutils.cpp @@ -226,7 +226,7 @@ INT_PTR CALLBACK gg_userutildlgproc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA BOOL enable;
GetDlgItemTextA(hwndDlg, IDC_PASSWORD, pass, SIZEOF(pass));
GetDlgItemTextA(hwndDlg, IDC_CPASSWORD, cpass, SIZEOF(cpass));
- enable = strlen(pass) && strlen(cpass) && !strcmp(cpass, pass);
+ enable = mir_strlen(pass) && mir_strlen(cpass) && !strcmp(cpass, pass);
if (dat && dat->mode == GG_USERUTIL_REMOVE)
EnableWindow(GetDlgItem(hwndDlg, IDOK), IsDlgButtonChecked(hwndDlg, IDC_CONFIRM) ? enable : FALSE);
else
diff --git a/protocols/ICQCorp/src/corp.cpp b/protocols/ICQCorp/src/corp.cpp index ef8bff0dd8..a1dd243c59 100644 --- a/protocols/ICQCorp/src/corp.cpp +++ b/protocols/ICQCorp/src/corp.cpp @@ -70,7 +70,7 @@ extern "C" __declspec(dllexport) int Load() GetModuleFileName(hInstance, fileName, MAX_PATH);
FindClose(FindFirstFile(fileName, &findData));
- findData.cFileName[strlen(findData.cFileName) - 4] = 0;
+ findData.cFileName[mir_strlen(findData.cFileName) - 4] = 0;
strcpy(protoName, findData.cFileName);
CallService(MS_PROTO_REGISTERMODULE, 0, (LPARAM)&pd);
@@ -110,8 +110,8 @@ void T(char *format, ...) hFile = CreateFile("ICQ Corp.log", GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_ALWAYS, 0, NULL);
SetFilePointer(hFile, 0, 0, FILE_END);
}
- WriteFile(hFile, bufferTime, (DWORD)strlen(bufferTime), &result, NULL);
- WriteFile(hFile, buffer, (DWORD)strlen(buffer), &result, NULL);
+ WriteFile(hFile, bufferTime, (DWORD)mir_strlen(bufferTime), &result, NULL);
+ WriteFile(hFile, buffer, (DWORD)mir_strlen(buffer), &result, NULL);
}
#endif
diff --git a/protocols/ICQCorp/src/packet.cpp b/protocols/ICQCorp/src/packet.cpp index 0baebee9a7..45f753ef41 100644 --- a/protocols/ICQCorp/src/packet.cpp +++ b/protocols/ICQCorp/src/packet.cpp @@ -109,7 +109,7 @@ Packet &Packet::operator << (unsigned char data) Packet &Packet::operator << (char *data)
{
- unsigned int s = (unsigned int)strlen(data) + 1;
+ unsigned int s = (unsigned int)mir_strlen(data) + 1;
operator << ((unsigned short)s);
memcpy(nextData, data, s);
sizeVal += s;
diff --git a/protocols/ICQCorp/src/protocol.cpp b/protocols/ICQCorp/src/protocol.cpp index 25967327d5..439add0b1e 100644 --- a/protocols/ICQCorp/src/protocol.cpp +++ b/protocols/ICQCorp/src/protocol.cpp @@ -913,7 +913,7 @@ void ICQ::processSystemMessage(Packet &packet, unsigned long checkUin, unsigned case ICQ_CMDxRCV_SYSxBROADCAST:
T("broadcast message from %d\n", checkUin);
- messageLen = (unsigned int)strlen(message);
+ messageLen = (unsigned int)mir_strlen(message);
for (i=0; i<messageLen; i++) if (message[i] == (char)0xFE) message[i] = '\n';
addMessage(u, message, ICQ_CMDxRCV_SYSxMSGxONLINE, ICQ_CMDxTCP_MSG, 0, timeSent);
@@ -1567,9 +1567,9 @@ ICQEvent *ICQ::sendUrl(ICQUser *u, char *url) char *m, *description;
ICQEvent *result;
- nameLen = (unsigned int)strlen(url);
+ nameLen = (unsigned int)mir_strlen(url);
description = (char*)url + nameLen + 1;
- descriptionLen = (unsigned int)strlen(description);
+ descriptionLen = (unsigned int)mir_strlen(description);
m = new char[nameLen + descriptionLen + 2];
strcpy(m, description);
@@ -2261,13 +2261,13 @@ void ICQ::addAdded(ICQUser *u, char *m, unsigned short theCmd, unsigned short th dbei.timestamp=TimestampLocalToGMT(YMDHMSToTime(year,month,day,hour,minute,0));
dbei.flags=0;
dbei.eventType=EVENTTYPE_ADDED;
- dbei.cbBlob=sizeof(DWORD)+strlen(nick)+strlen(first)+strlen(last)+strlen(email)+4;
+ dbei.cbBlob=sizeof(DWORD)+mir_strlen(nick)+mir_strlen(first)+mir_strlen(last)+mir_strlen(email)+4;
pCurBlob=dbei.pBlob=(PBYTE)malloc(dbei.cbBlob);
CopyMemory(pCurBlob,&uin,sizeof(DWORD)); pCurBlob+=sizeof(DWORD);
- CopyMemory(pCurBlob,nick,strlen(nick)+1); pCurBlob+=strlen(nick)+1;
- CopyMemory(pCurBlob,first,strlen(first)+1); pCurBlob+=strlen(first)+1;
- CopyMemory(pCurBlob,last,strlen(last)+1); pCurBlob+=strlen(last)+1;
- CopyMemory(pCurBlob,email,strlen(email)+1); pCurBlob+=strlen(email)+1;
+ CopyMemory(pCurBlob,nick,mir_strlen(nick)+1); pCurBlob+=mir_strlen(nick)+1;
+ CopyMemory(pCurBlob,first,mir_strlen(first)+1); pCurBlob+=mir_strlen(first)+1;
+ CopyMemory(pCurBlob,last,mir_strlen(last)+1); pCurBlob+=mir_strlen(last)+1;
+ CopyMemory(pCurBlob,email,mir_strlen(email)+1); pCurBlob+=mir_strlen(email)+1;
CallService(MS_DB_EVENT_ADD,(WPARAM)(HANDLE)NULL,(LPARAM)&dbei);
}
*/
@@ -2304,11 +2304,11 @@ void ICQ::addFileReq(ICQUser *u, char *m, char *filename, unsigned long size, un // Send chain event
- szBlob = new char[sizeof(DWORD) + strlen(filename) + strlen(m) + 2];
+ szBlob = new char[sizeof(DWORD) + mir_strlen(filename) + mir_strlen(m) + 2];
*(PDWORD)szBlob = (DWORD)transfer;
strcpy(szBlob + sizeof(DWORD), filename);
- strcpy(szBlob + sizeof(DWORD) + strlen(filename) + 1, m);
+ strcpy(szBlob + sizeof(DWORD) + mir_strlen(filename) + 1, m);
ccs.hContact = u->hContact;
ccs.szProtoService = PSR_FILE;
diff --git a/protocols/ICQCorp/src/services.cpp b/protocols/ICQCorp/src/services.cpp index a94fa5450c..20796a0efb 100644 --- a/protocols/ICQCorp/src/services.cpp +++ b/protocols/ICQCorp/src/services.cpp @@ -275,7 +275,7 @@ static INT_PTR icqSetAwayMsg(WPARAM wParam, LPARAM lParam) if (lParam == NULL) return 0;
if (icq.awayMessage) delete [] icq.awayMessage;
- icq.awayMessage = new char[strlen((char*)lParam) + 1];
+ icq.awayMessage = new char[mir_strlen((char*)lParam) + 1];
strcpy(icq.awayMessage, (char*)lParam);
return 0;
@@ -446,7 +446,7 @@ static INT_PTR icqRecvFile(WPARAM wParam, LPARAM lParam) db_unset(ccs->hContact, "CList", "Hidden");
szFile = pre->szMessage + sizeof(DWORD);
- szDesc = szFile + strlen(szFile) + 1;
+ szDesc = szFile + mir_strlen(szFile) + 1;
ZeroMemory(&dbei, sizeof(dbei));
dbei.cbSize = sizeof(dbei);
@@ -454,7 +454,7 @@ static INT_PTR icqRecvFile(WPARAM wParam, LPARAM lParam) dbei.timestamp = pre->timestamp;
dbei.flags = pre->flags & (PREF_CREATEREAD ? DBEF_READ : 0);
dbei.eventType = EVENTTYPE_FILE;
- dbei.cbBlob = sizeof(DWORD)+(DWORD)strlen(szFile) + (DWORD)strlen(szDesc) + 2;
+ dbei.cbBlob = sizeof(DWORD)+(DWORD)mir_strlen(szFile) + (DWORD)mir_strlen(szDesc) + 2;
dbei.pBlob = (PBYTE)pre->szMessage;
db_event_add(ccs->hContact, &dbei);
diff --git a/protocols/ICQCorp/src/transfer.cpp b/protocols/ICQCorp/src/transfer.cpp index eb1a8dbf7b..a16369bd67 100644 --- a/protocols/ICQCorp/src/transfer.cpp +++ b/protocols/ICQCorp/src/transfer.cpp @@ -110,7 +110,7 @@ void ICQTransfer::processTcpPacket(Packet &packet) if (directoryName[0])
{
- char *fullName = new char[strlen(directoryName) + strlen(files[current]) + 2];
+ char *fullName = new char[mir_strlen(directoryName) + mir_strlen(files[current]) + 2];
sprintf(fullName, "%s\\%s", directoryName, files[current]);
delete [] files[current];
files[current] = fullName;
@@ -234,7 +234,7 @@ void ICQTransfer::sendPacket0x02() packet << (unsigned char)0x02
<< directory
<< (strrchr(fileName, '\\') + 1)
- << (directoryName + strlen(path) + 1)
+ << (directoryName + mir_strlen(path) + 1)
<< fileSize
<< fileDate
<< speed;
@@ -396,7 +396,7 @@ void ICQTransfer::resume(int action, const char *newName) case FILERESUME_RENAME:
T("[ ] rename file\n");
delete [] fileName;
- fileName = new char[strlen(newName) + 1];
+ fileName = new char[mir_strlen(newName) + 1];
strcpy(fileName, newName);
files[current] = fileName;
diff --git a/protocols/IRCG/src/commandmonitor.cpp b/protocols/IRCG/src/commandmonitor.cpp index 824588b369..9d73f4b92c 100644 --- a/protocols/IRCG/src/commandmonitor.cpp +++ b/protocols/IRCG/src/commandmonitor.cpp @@ -228,7 +228,7 @@ int CIrcProto::AddOutgoingMessageToDB(MCONTACT hContact, TCHAR* msg) dbei.timestamp = (DWORD)time(NULL);
dbei.flags = DBEF_SENT + DBEF_UTF;
dbei.pBlob = (PBYTE)mir_utf8encodeW(S.c_str());
- dbei.cbBlob = (DWORD)strlen((char*)dbei.pBlob) + 1;
+ dbei.cbBlob = (DWORD)mir_strlen((char*)dbei.pBlob) + 1;
db_event_add(hContact, &dbei);
mir_free(dbei.pBlob);
return 1;
diff --git a/protocols/IRCG/src/irclib.cpp b/protocols/IRCG/src/irclib.cpp index eaee830928..d330cc0963 100644 --- a/protocols/IRCG/src/irclib.cpp +++ b/protocols/IRCG/src/irclib.cpp @@ -176,7 +176,7 @@ void CIrcProto::SendIrcMessage(const TCHAR* msg, bool bNotify, int codepage) if (this) { char* str = mir_t2a_cp(msg, codepage); rtrim(str); - int cbLen = (int)strlen(str); + int cbLen = (int)mir_strlen(str); str = (char*)mir_realloc(str, cbLen + 3); strcat(str, "\r\n"); NLSend((const BYTE*)str, cbLen + 2); @@ -293,7 +293,7 @@ int CIrcProto::NLSend(const TCHAR* fmt, ...) va_end(marker); char* buf = mir_t2a_cp(szBuf, getCodepage()); - int result = NLSend((unsigned char*)buf, (int)strlen(buf)); + int result = NLSend((unsigned char*)buf, (int)mir_strlen(buf)); mir_free(buf); return result; } diff --git a/protocols/IRCG/src/options.cpp b/protocols/IRCG/src/options.cpp index abc5ef02dd..e7582fe1a9 100644 --- a/protocols/IRCG/src/options.cpp +++ b/protocols/IRCG/src/options.cpp @@ -45,7 +45,7 @@ void CIrcProto::ReadSettings(TDbSetting* sets, int count) case DBVT_ASCIIZ:
if (!getString(p->name, &dbv)) {
if (p->size != -1) {
- size_t len = min(p->size - 1, strlen(dbv.pszVal));
+ size_t len = min(p->size - 1, mir_strlen(dbv.pszVal));
memcpy(ptr, dbv.pszVal, len);
ptr[len] = 0;
}
diff --git a/protocols/IcqOscarJ/src/stdpackets.cpp b/protocols/IcqOscarJ/src/stdpackets.cpp index 59c0b51efc..dcda61cc90 100644 --- a/protocols/IcqOscarJ/src/stdpackets.cpp +++ b/protocols/IcqOscarJ/src/stdpackets.cpp @@ -659,7 +659,7 @@ void CIcqProto::icq_sendSetAimAwayMsgServ(const char *szMsg) if (IsUSASCII(szMsg, wMsgLen)) {
const char* fmt = "text/x-aolrtf; charset=\"us-ascii\"";
- size_t fmtlen = strlen(fmt);
+ size_t fmtlen = mir_strlen(fmt);
serverPacketInit(&packet, 23 + wMsgLen + fmtlen);
packFNACHeader(&packet, ICQ_LOCATION_FAMILY, ICQ_LOCATION_SET_USER_INFO, 0, dwCookie);
@@ -669,7 +669,7 @@ void CIcqProto::icq_sendSetAimAwayMsgServ(const char *szMsg) }
else {
const char* fmt = "text/x-aolrtf; charset=\"unicode-2-0\"";
- size_t fmtlen = strlen(fmt);
+ size_t fmtlen = mir_strlen(fmt);
WCHAR *szMsgW = make_unicode_string(szMsg);
wMsgLen = mir_wstrlen(szMsgW) * sizeof(WCHAR);
diff --git a/protocols/JabberG/src/jabber_archive.cpp b/protocols/JabberG/src/jabber_archive.cpp index 8b23af83a5..18fbec6911 100644 --- a/protocols/JabberG/src/jabber_archive.cpp +++ b/protocols/JabberG/src/jabber_archive.cpp @@ -293,7 +293,7 @@ void CJabberProto::OnIqResultGetCollection(HXML iqNode, CJabberIqInfo*) DBEVENTINFO dbei = { sizeof(DBEVENTINFO) };
dbei.eventType = EVENTTYPE_MESSAGE;
dbei.szModule = m_szModuleName;
- dbei.cbBlob = (DWORD)strlen(szEventText);
+ dbei.cbBlob = (DWORD)mir_strlen(szEventText);
dbei.flags = DBEF_READ + DBEF_UTF + from;
dbei.pBlob = (PBYTE)(char*)szEventText;
dbei.timestamp = tmStart + _ttol(tszSecs) - timezone;
diff --git a/protocols/JabberG/src/jabber_frame.cpp b/protocols/JabberG/src/jabber_frame.cpp index 457b0bbde9..150b22e5d4 100644 --- a/protocols/JabberG/src/jabber_frame.cpp +++ b/protocols/JabberG/src/jabber_frame.cpp @@ -469,7 +469,7 @@ void CJabberInfoFrame::UpdateInfoItem(char *pszName, HANDLE hIcolibIcon, TCHAR * void CJabberInfoFrame::ShowInfoItem(char *pszName, bool bShow)
{
bool bUpdate = false;
- size_t length = strlen(pszName);
+ size_t length = mir_strlen(pszName);
for (int i=0; i < m_pItems.getCount(); i++)
if ((m_pItems[i].m_bShow != bShow) && !strncmp(m_pItems[i].m_pszName, pszName, length)) {
m_pItems[i].m_bShow = bShow;
@@ -484,7 +484,7 @@ void CJabberInfoFrame::ShowInfoItem(char *pszName, bool bShow) void CJabberInfoFrame::RemoveInfoItem(char *pszName)
{
bool bUpdate = false;
- size_t length = strlen(pszName);
+ size_t length = mir_strlen(pszName);
for (int i=0; i < m_pItems.getCount(); i++)
if (!strncmp(m_pItems[i].m_pszName, pszName, length)) {
if (!m_pItems[i].m_bShow) --m_hiddenItemCount;
diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp index d2923a76d1..5c2715f7bf 100644 --- a/protocols/JabberG/src/jabber_menu.cpp +++ b/protocols/JabberG/src/jabber_menu.cpp @@ -434,7 +434,7 @@ int CJabberProto::OnPrebuildContactMenu(WPARAM hContact, LPARAM) char text[ 256 ];
strcpy(text, m_szModuleName);
- size_t nModuleNameLength = strlen(text);
+ size_t nModuleNameLength = mir_strlen(text);
char* tDest = text + nModuleNameLength;
mi.flags = CMIF_CHILDPOPUP;
@@ -603,7 +603,7 @@ void CJabberProto::MenuInit() {
char text[200];
strncpy(text, m_szModuleName, sizeof(text)-1);
- char* tDest = text + strlen(text);
+ char* tDest = text + mir_strlen(text);
CLISTMENUITEM mi = { sizeof(mi) };
mi.pszService = text;
@@ -727,7 +727,7 @@ void CJabberProto::MenuInit() m_hMenuPriorityRoot = Menu_AddProtoMenuItem(&mi);
TCHAR szName[128];
- char srvFce[MAX_PATH + 64], *svcName = srvFce + strlen(m_szModuleName);
+ char srvFce[MAX_PATH + 64], *svcName = srvFce + mir_strlen(m_szModuleName);
mi.pszService = srvFce;
mi.ptszName = szName;
mi.position = 2000040000;
@@ -826,7 +826,7 @@ void CJabberProto::GlobalMenuInit() char text[200];
strncpy(text, m_szModuleName, sizeof(text) - 1);
- char* tDest = text + strlen(text);
+ char* tDest = text + mir_strlen(text);
HOTKEYDESC hkd = { sizeof(hkd) };
hkd.pszName = text;
diff --git a/protocols/JabberG/src/jabber_misc.cpp b/protocols/JabberG/src/jabber_misc.cpp index 36156ae559..5159477d75 100644 --- a/protocols/JabberG/src/jabber_misc.cpp +++ b/protocols/JabberG/src/jabber_misc.cpp @@ -83,14 +83,14 @@ void CJabberProto::DBAddAuthRequest(const TCHAR *jid, const TCHAR *nick) dbei.timestamp = (DWORD)time(NULL);
dbei.flags = DBEF_UTF;
dbei.eventType = EVENTTYPE_AUTHREQUEST;
- dbei.cbBlob = (DWORD)(sizeof(DWORD)*2 + strlen(szNick) + strlen(szJid) + 5);
+ dbei.cbBlob = (DWORD)(sizeof(DWORD)*2 + mir_strlen(szNick) + mir_strlen(szJid) + 5);
PBYTE pCurBlob = dbei.pBlob = (PBYTE)mir_alloc(dbei.cbBlob);
*((PDWORD)pCurBlob) = 0; pCurBlob += sizeof(DWORD);
*((PDWORD)pCurBlob) = (DWORD)hContact; pCurBlob += sizeof(DWORD);
- strcpy((char*)pCurBlob, szNick); pCurBlob += strlen(szNick)+1;
+ strcpy((char*)pCurBlob, szNick); pCurBlob += mir_strlen(szNick)+1;
*pCurBlob = '\0'; pCurBlob++; //firstName
*pCurBlob = '\0'; pCurBlob++; //lastName
- strcpy((char*)pCurBlob, szJid); pCurBlob += strlen(szJid)+1;
+ strcpy((char*)pCurBlob, szJid); pCurBlob += mir_strlen(szJid)+1;
*pCurBlob = '\0'; //reason
db_event_add(NULL, &dbei);
diff --git a/protocols/JabberG/src/jabber_opt.cpp b/protocols/JabberG/src/jabber_opt.cpp index bc964b58f1..4116d1ac6b 100644 --- a/protocols/JabberG/src/jabber_opt.cpp +++ b/protocols/JabberG/src/jabber_opt.cpp @@ -1235,7 +1235,7 @@ void CJabberProto::_RosterExportToFile(HWND hwndDlg) char *tmp = mir_utf8encodeT(xtmp);
xi.freeMem(xtmp);
- fwrite(tmp, 1, strlen(tmp), fp);
+ fwrite(tmp, 1, mir_strlen(tmp), fp);
mir_free(tmp);
fclose(fp);
}
diff --git a/protocols/JabberG/src/jabber_privacy.cpp b/protocols/JabberG/src/jabber_privacy.cpp index f40f94429f..f20c678d00 100644 --- a/protocols/JabberG/src/jabber_privacy.cpp +++ b/protocols/JabberG/src/jabber_privacy.cpp @@ -2121,7 +2121,7 @@ void CJabberProto::BuildPrivacyListsMenu(bool bDeleteOld) mir_cslock lck(m_privacyListManager.m_cs);
- char srvFce[MAX_PATH + 64], *svcName = srvFce + strlen(m_szModuleName);
+ char srvFce[MAX_PATH + 64], *svcName = srvFce + mir_strlen(m_szModuleName);
CLISTMENUITEM mi = { sizeof(mi) };
mi.position = 2000040000;
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index a7663e7624..0df2add95a 100644 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -365,9 +365,9 @@ MCONTACT __cdecl CJabberProto::AddToListByEvent(int flags, int /*iContact*/, MEV return NULL;
char *nick = (char*)(dbei.pBlob + sizeof(DWORD)*2);
- char *firstName = nick + strlen(nick) + 1;
- char *lastName = firstName + strlen(firstName) + 1;
- char *jid = lastName + strlen(lastName) + 1;
+ char *firstName = nick + mir_strlen(nick) + 1;
+ char *lastName = firstName + mir_strlen(firstName) + 1;
+ char *jid = lastName + mir_strlen(lastName) + 1;
TCHAR *newJid = (dbei.flags & DBEF_UTF) ? mir_utf8decodeT(jid) : mir_a2t(jid);
MCONTACT hContact = (MCONTACT)AddToListByJID(newJid, flags);
@@ -396,9 +396,9 @@ int CJabberProto::Authorize(MEVENT hDbEvent) return 1;
char *nick = (char*)(dbei.pBlob + sizeof(DWORD)*2);
- char *firstName = nick + strlen(nick) + 1;
- char *lastName = firstName + strlen(firstName) + 1;
- char *jid = lastName + strlen(lastName) + 1;
+ char *firstName = nick + mir_strlen(nick) + 1;
+ char *lastName = firstName + mir_strlen(firstName) + 1;
+ char *jid = lastName + mir_strlen(lastName) + 1;
debugLog(_T("Send 'authorization allowed' to %s"), jid);
@@ -450,9 +450,9 @@ int CJabberProto::AuthDeny(MEVENT hDbEvent, const TCHAR*) return 1;
char *nick = (char*)(dbei.pBlob + sizeof(DWORD)*2);
- char *firstName = nick + strlen(nick) + 1;
- char *lastName = firstName + strlen(firstName) + 1;
- char *jid = lastName + strlen(lastName) + 1;
+ char *firstName = nick + mir_strlen(nick) + 1;
+ char *lastName = firstName + mir_strlen(firstName) + 1;
+ char *jid = lastName + mir_strlen(lastName) + 1;
debugLogA("Send 'authorization denied' to %s", jid);
@@ -966,11 +966,11 @@ int __cdecl CJabberProto::SendMsg(MCONTACT hContact, int, const char* pszSrc) }
int isEncrypted, id = SerialNext();
- if (!strncmp(pszSrc, PGP_PROLOG, strlen(PGP_PROLOG))) {
+ if (!strncmp(pszSrc, PGP_PROLOG, mir_strlen(PGP_PROLOG))) {
const char *szEnd = strstr(pszSrc, PGP_EPILOG);
- char *tempstring = (char*)alloca(strlen(pszSrc) + 1);
- size_t nStrippedLength = strlen(pszSrc) - strlen(PGP_PROLOG) - (szEnd ? strlen(szEnd) : 0);
- strncpy_s(tempstring, nStrippedLength, pszSrc + strlen(PGP_PROLOG), _TRUNCATE);
+ char *tempstring = (char*)alloca(mir_strlen(pszSrc) + 1);
+ size_t nStrippedLength = mir_strlen(pszSrc) - mir_strlen(PGP_PROLOG) - (szEnd ? mir_strlen(szEnd) : 0);
+ strncpy_s(tempstring, nStrippedLength, pszSrc + mir_strlen(PGP_PROLOG), _TRUNCATE);
tempstring[nStrippedLength] = 0;
pszSrc = tempstring;
isEncrypted = 1;
diff --git a/protocols/JabberG/src/jabber_rc.cpp b/protocols/JabberG/src/jabber_rc.cpp index 154db21e39..b83d3ef89c 100644 --- a/protocols/JabberG/src/jabber_rc.cpp +++ b/protocols/JabberG/src/jabber_rc.cpp @@ -580,7 +580,7 @@ int CJabberProto::AdhocForwardHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhocSe HXML addressesNode = msg << XCHILDNS(_T("addresses"), JABBER_FEAT_EXT_ADDRESSING);
TCHAR szOFrom[JABBER_MAX_JID_LEN];
- size_t cbBlob = strlen((LPSTR)dbei.pBlob)+1;
+ size_t cbBlob = mir_strlen((LPSTR)dbei.pBlob)+1;
if (cbBlob < dbei.cbBlob) { // rest of message contains a sender's resource
ptrT szOResource( mir_utf8decodeT((LPSTR)dbei.pBlob + cbBlob+1));
mir_sntprintf(szOFrom, SIZEOF(szOFrom), _T("%s/%s"), tszJid, szOResource);
diff --git a/protocols/JabberG/src/jabber_secur.cpp b/protocols/JabberG/src/jabber_secur.cpp index d840ddcd89..3d380eb32a 100644 --- a/protocols/JabberG/src/jabber_secur.cpp +++ b/protocols/JabberG/src/jabber_secur.cpp @@ -162,37 +162,37 @@ char* TMD5Auth::getChallenge(const TCHAR *challenge) serv(mir_utf8encode(info->conn.server));
mir_md5_init(&ctx);
- mir_md5_append(&ctx, (BYTE*)(char*)uname, (int)strlen(uname));
+ mir_md5_append(&ctx, (BYTE*)(char*)uname, (int)mir_strlen(uname));
mir_md5_append(&ctx, (BYTE*)":", 1);
- mir_md5_append(&ctx, (BYTE*)realm, (int)strlen(realm));
+ mir_md5_append(&ctx, (BYTE*)realm, (int)mir_strlen(realm));
mir_md5_append(&ctx, (BYTE*)":", 1);
- mir_md5_append(&ctx, (BYTE*)(char*)passw, (int)strlen(passw));
+ mir_md5_append(&ctx, (BYTE*)(char*)passw, (int)mir_strlen(passw));
mir_md5_finish(&ctx, (BYTE*)hash1);
mir_md5_init(&ctx);
mir_md5_append(&ctx, (BYTE*)hash1, 16);
mir_md5_append(&ctx, (BYTE*)":", 1);
- mir_md5_append(&ctx, (BYTE*)nonce, (int)strlen(nonce));
+ mir_md5_append(&ctx, (BYTE*)nonce, (int)mir_strlen(nonce));
mir_md5_append(&ctx, (BYTE*)":", 1);
- mir_md5_append(&ctx, (BYTE*)cnonce, (int)strlen(cnonce));
+ mir_md5_append(&ctx, (BYTE*)cnonce, (int)mir_strlen(cnonce));
mir_md5_finish(&ctx, (BYTE*)hash1);
mir_md5_init(&ctx);
mir_md5_append(&ctx, (BYTE*)"AUTHENTICATE:xmpp/", 18);
- mir_md5_append(&ctx, (BYTE*)(char*)serv, (int)strlen(serv));
+ mir_md5_append(&ctx, (BYTE*)(char*)serv, (int)mir_strlen(serv));
mir_md5_finish(&ctx, (BYTE*)hash2);
mir_md5_init(&ctx);
mir_snprintf(tmpBuf, SIZEOF(tmpBuf), "%08x%08x%08x%08x", htonl(hash1[0]), htonl(hash1[1]), htonl(hash1[2]), htonl(hash1[3]));
- mir_md5_append(&ctx, (BYTE*)tmpBuf, (int)strlen(tmpBuf));
+ mir_md5_append(&ctx, (BYTE*)tmpBuf, (int)mir_strlen(tmpBuf));
mir_md5_append(&ctx, (BYTE*)":", 1);
- mir_md5_append(&ctx, (BYTE*)nonce, (int)strlen(nonce));
+ mir_md5_append(&ctx, (BYTE*)nonce, (int)mir_strlen(nonce));
mir_snprintf(tmpBuf, SIZEOF(tmpBuf), ":%08d:", iCallCount);
- mir_md5_append(&ctx, (BYTE*)tmpBuf, (int)strlen(tmpBuf));
- mir_md5_append(&ctx, (BYTE*)cnonce, (int)strlen(cnonce));
+ 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, SIZEOF(tmpBuf), "%08x%08x%08x%08x", htonl(hash2[0]), htonl(hash2[1]), htonl(hash2[2]), htonl(hash2[3]));
- mir_md5_append(&ctx, (BYTE*)tmpBuf, (int)strlen(tmpBuf));
+ mir_md5_append(&ctx, (BYTE*)tmpBuf, (int)mir_strlen(tmpBuf));
mir_md5_finish(&ctx, (BYTE*)digest);
char *buf = (char*)alloca(8000);
@@ -249,7 +249,7 @@ char* TScramAuth::getChallenge(const TCHAR *challenge) for (char *p = strtok(NEWSTR_ALLOCA(chl), ","); p != NULL; p = strtok(NULL, ",")) {
if (*p == 'r' && p[1] == '=') { // snonce
- if (strncmp(cnonce, p + 2, strlen(cnonce)))
+ if (strncmp(cnonce, p + 2, mir_strlen(cnonce)))
return NULL;
snonce = mir_strdup(p + 2);
}
@@ -263,7 +263,7 @@ char* TScramAuth::getChallenge(const TCHAR *challenge) return NULL;
ptrA passw(mir_utf8encodeT(info->conn.password));
- size_t passwLen = strlen(passw);
+ size_t passwLen = mir_strlen(passw);
BYTE saltedPassw[MIR_SHA1_HASH_SIZE];
Hi(saltedPassw, passw, passwLen, salt, saltLen, ind);
@@ -341,7 +341,7 @@ char* TPlainAuth::getInitialRequest() {
ptrA uname(mir_utf8encodeT(info->conn.username)), passw(mir_utf8encodeT(info->conn.password));
- size_t size = 2 * strlen(uname) + strlen(passw) + strlen(info->conn.server) + 4;
+ size_t size = 2 * mir_strlen(uname) + mir_strlen(passw) + mir_strlen(info->conn.server) + 4;
char *toEncode = (char*)alloca(size);
if (bOld)
size = mir_snprintf(toEncode, size, "%s@%s%c%s%c%s", uname, info->conn.server, 0, uname, 0, passw);
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index f185af3e33..66ef740ca8 100644 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -206,7 +206,7 @@ void CJabberProto::xmlStreamInitializeNow(ThreadData *info) LPTSTR xmlQuery = xi.toString(n, NULL);
char* buf = mir_utf8encodeT(xmlQuery);
- int bufLen = (int)strlen(buf);
+ int bufLen = (int)mir_strlen(buf);
if (bufLen > 2) {
strdel(buf + bufLen - 2, 1);
bufLen--;
@@ -392,7 +392,7 @@ LBL_FatalError: // User may change status to OFFLINE while we are connecting above
if (m_iDesiredStatus != ID_STATUS_OFFLINE || info.bIsReg) {
if (!info.bIsReg) {
- size_t len = _tcslen(info.conn.username) + strlen(info.conn.server) + 1;
+ size_t len = _tcslen(info.conn.username) + mir_strlen(info.conn.server) + 1;
m_szJabberJID = (TCHAR*)mir_alloc(sizeof(TCHAR)*(len + 1));
mir_sntprintf(m_szJabberJID, len + 1, _T("%s@%S"), info.conn.username, info.conn.server);
m_bSendKeepAlive = m_options.KeepAlive != 0;
@@ -1229,8 +1229,8 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info) if (xmlGetChild(xNode, "delivered") != NULL || xmlGetChild(xNode, "offline") != NULL) {
int id = -1;
if (idNode != NULL && xmlGetText(idNode) != NULL)
- if (!_tcsncmp(xmlGetText(idNode), _T(JABBER_IQID), strlen(JABBER_IQID)))
- id = _ttoi((xmlGetText(idNode)) + strlen(JABBER_IQID));
+ if (!_tcsncmp(xmlGetText(idNode), _T(JABBER_IQID), mir_strlen(JABBER_IQID)))
+ id = _ttoi((xmlGetText(idNode)) + mir_strlen(JABBER_IQID));
if (id != -1)
ProtoBroadcastAck(hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)id, 0);
@@ -1943,7 +1943,7 @@ int ThreadData::send(char* buffer, int bufsize) return 0;
if (bufsize == -1)
- bufsize = (int)strlen(buffer);
+ bufsize = (int)mir_strlen(buffer);
WaitForSingleObject(iomutex, 6000);
@@ -1988,7 +1988,7 @@ int ThreadData::send(HXML node) char* utfStr = mir_utf8encodeT(str);
- int result = send(utfStr, (int)strlen(utfStr));
+ int result = send(utfStr, (int)mir_strlen(utfStr));
mir_free(utfStr);
xi.freeMem(str);
diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp index 2c7da1dafe..5416ffa74f 100644 --- a/protocols/JabberG/src/jabber_util.cpp +++ b/protocols/JabberG/src/jabber_util.cpp @@ -170,7 +170,7 @@ char* __stdcall JabberSha1(const char *str, JabberShaStrBuf buf) BYTE digest[MIR_SHA1_HASH_SIZE];
mir_sha1_ctx sha;
mir_sha1_init(&sha);
- mir_sha1_append(&sha, (BYTE*)str, (int)strlen(str));
+ mir_sha1_append(&sha, (BYTE*)str, (int)mir_strlen(str));
mir_sha1_finish(&sha, digest);
bin2hex(digest, sizeof(digest), buf);
diff --git a/protocols/MRA/src/MraProto.cpp b/protocols/MRA/src/MraProto.cpp index f22cb1cfdf..427638fc65 100644 --- a/protocols/MRA/src/MraProto.cpp +++ b/protocols/MRA/src/MraProto.cpp @@ -170,9 +170,9 @@ MCONTACT CMraProto::AddToListByEvent(int, int, MEVENT hDbEvent) (dbei.eventType == EVENTTYPE_AUTHREQUEST || dbei.eventType == EVENTTYPE_CONTACTS))
{
char *nick = (char*)(dbei.pBlob + sizeof(DWORD) * 2);
- char *firstName = nick + strlen(nick) + 1;
- char *lastName = firstName + strlen(firstName) + 1;
- char *email = lastName + strlen(lastName) + 1;
+ char *firstName = nick + mir_strlen(nick) + 1;
+ char *lastName = firstName + mir_strlen(firstName) + 1;
+ char *email = lastName + mir_strlen(lastName) + 1;
return AddToListByEmail(_A2T(email), _A2T(nick), _A2T(firstName), _A2T(lastName), 0);
}
}
diff --git a/protocols/MRA/src/MraSendCommand.cpp b/protocols/MRA/src/MraSendCommand.cpp index 4852f8a19e..873394ba0e 100644 --- a/protocols/MRA/src/MraSendCommand.cpp +++ b/protocols/MRA/src/MraSendCommand.cpp @@ -90,7 +90,7 @@ DWORD CMraProto::MraMessage(BOOL bAddToQueue, MCONTACT hContact, DWORD dwAckType buf.SetLPSW(_T(""));//***deb possible nick here
buf.SetLPSW(lpwszMessage);
lpszMessageConverted = mir_base64_encode(buf.Data(), (int)buf.Len());
- dwMessageConvertedSize = strlen(lpszMessageConverted);
+ dwMessageConvertedSize = mir_strlen(lpszMessageConverted);
}
// messages with Flash
else if (dwFlags & MESSAGE_FLAG_FLASH) {
diff --git a/protocols/MRA/src/Mra_functions.cpp b/protocols/MRA/src/Mra_functions.cpp index 26ccd72fe8..d2f84ff04f 100644 --- a/protocols/MRA/src/Mra_functions.cpp +++ b/protocols/MRA/src/Mra_functions.cpp @@ -670,7 +670,7 @@ void CMraProto::MraUpdateEmailStatus(const CMStringA &pszFrom, const CMStringA & if (getByte("TrayIconNewMailClkToInbox", MRA_DEFAULT_TRAYICON_NEW_MAIL_CLK_TO_INBOX)) {
strncpy(szServiceFunction, m_szModuleName, MAX_PATH);
- pszServiceFunctionName = szServiceFunction + strlen(m_szModuleName);
+ pszServiceFunctionName = szServiceFunction + mir_strlen(m_szModuleName);
memcpy(pszServiceFunctionName, MRA_GOTO_INBOX, sizeof(MRA_GOTO_INBOX));
cle.pszService = szServiceFunction;
}
diff --git a/protocols/MRA/src/Mra_menus.cpp b/protocols/MRA/src/Mra_menus.cpp index 4fcf9cbdd0..1638ad1054 100644 --- a/protocols/MRA/src/Mra_menus.cpp +++ b/protocols/MRA/src/Mra_menus.cpp @@ -279,7 +279,7 @@ int CMraProto::MraRebuildStatusMenu(WPARAM, LPARAM) {
CHAR szServiceFunction[MAX_PATH * 2], *pszServiceFunctionName, szValueName[MAX_PATH];
strncpy(szServiceFunction, m_szModuleName, sizeof(szServiceFunction));
- pszServiceFunctionName = szServiceFunction + strlen(m_szModuleName);
+ pszServiceFunctionName = szServiceFunction + mir_strlen(m_szModuleName);
TCHAR szItem[MAX_PATH + 64];
mir_sntprintf(szItem, SIZEOF(szItem), _T("%s Custom Status"), m_tszUserName);
@@ -327,7 +327,7 @@ HGENMENU CMraProto::CListCreateMenu(LONG lPosition, LONG lPopupPosition, BOOL bI char szServiceFunction[MAX_PATH];
strncpy(szServiceFunction, m_szModuleName, sizeof(szServiceFunction));
- char *pszServiceFunctionName = szServiceFunction + strlen(m_szModuleName);
+ char *pszServiceFunctionName = szServiceFunction + mir_strlen(m_szModuleName);
CLISTMENUITEM mi = { sizeof(mi) };
diff --git a/protocols/MRA/src/Mra_proto.cpp b/protocols/MRA/src/Mra_proto.cpp index f17cc8ce60..856ab61442 100644 --- a/protocols/MRA/src/Mra_proto.cpp +++ b/protocols/MRA/src/Mra_proto.cpp @@ -1763,7 +1763,7 @@ DWORD CMraProto::MraRecvCommand_Message(DWORD dwTime, DWORD dwFlags, CMStringA & ptrA lpbBuffer(mir_u2a_cp(wszMessage, MRA_CODE_PAGE));
pre.flags = 0;
pre.szMessage = (LPSTR)lpbBuffer;
- pre.lParam = strlen(lpbBuffer);
+ pre.lParam = mir_strlen(lpbBuffer);
LPSTR lpbBufferCurPos = lpbBuffer;
while (TRUE) { // öèêë çàìåíû ; íà 0
diff --git a/protocols/MSN/src/msn_auth.cpp b/protocols/MSN/src/msn_auth.cpp index ae8bc6814b..b54ef2c1ba 100644 --- a/protocols/MSN/src/msn_auth.cpp +++ b/protocols/MSN/src/msn_auth.cpp @@ -186,7 +186,7 @@ int CMsnProto::MSN_GetPassportAuth(void) const char *errurl;
{
errurl = NULL;
- ezxml_t xml = ezxml_parse_str(tResult, strlen(tResult));
+ ezxml_t xml = ezxml_parse_str(tResult, mir_strlen(tResult));
ezxml_t tokr = ezxml_get(xml, "S:Body", 0,
"wst:RequestSecurityTokenResponseCollection", 0,
@@ -389,7 +389,7 @@ char* CMsnProto::GenerateLoginBlob(char* challenge) derive_key(key2, key1, key1len, (unsigned char*)encdata1, sizeof(encdata1) - 1);
derive_key(key3, key1, key1len, (unsigned char*)encdata2, sizeof(encdata2) - 1);
- size_t chllen = strlen(challenge);
+ size_t chllen = mir_strlen(challenge);
BYTE hash[MIR_SHA1_HASH_SIZE];
mir_hmac_sha1(hash, key2, MIR_SHA1_HASH_SIZE + 4, (BYTE*)challenge, chllen);
@@ -576,7 +576,7 @@ static int CopyCookies(NETLIBHTTPREQUEST *nlhrReply, NETLIBHTTPHEADER *hdr) if (*hdr->szValue) strcat (hdr->szValue, "; ");
strcat (hdr->szValue, nlhrReply->headers[i].szValue);
}
- else nSize += (int)strlen(nlhrReply->headers[i].szValue) + 2;
+ else nSize += (int)mir_strlen(nlhrReply->headers[i].szValue) + 2;
}
return nSize;
}
@@ -618,7 +618,7 @@ bool CMsnProto::RefreshOAuth(const char *pszRefreshToken, const char *pszService ptrA(mir_urlEncode(pszService)), pszRefreshToken);
nlhr.pData = (char*)(const char*)post;
- nlhr.dataLength = (int)strlen(nlhr.pData);
+ nlhr.dataLength = (int)mir_strlen(nlhr.pData);
nlhr.szUrl = "https://login.live.com/oauth20_token.srf";
// Query
@@ -783,7 +783,7 @@ int CMsnProto::MSN_AuthOAuth(void) nlhr.requestType = REQUEST_POST;
nlhr.flags &= (~NLHRF_REDIRECT);
mHttpsTS = clock();
- nlhr.dataLength = (int)strlen(post);
+ nlhr.dataLength = (int)mir_strlen(post);
nlhr.pData = (char*)(const char*)post;
nlhr.nlc = hHttpsConnection;
NETLIBHTTPREQUEST *nlhrReply2 = (NETLIBHTTPREQUEST*)CallService(MS_NETLIB_HTTPTRANSACTION, (WPARAM)hNetlibUserHttps, (LPARAM)&nlhr);
@@ -848,7 +848,7 @@ int CMsnProto::MSN_AuthOAuth(void) /* Prepare headers*/
nlhr.headers[2].szValue = "application/json";
nlhr.pData = "{\"trouterurl\":\"https://\",\"connectionid\":\"a\"}";
- nlhr.dataLength = (int)strlen(nlhr.pData);
+ nlhr.dataLength = (int)mir_strlen(nlhr.pData);
nlhr.szUrl = "https://skypewebexperience.live.com/v1/User/Initialization";
nlhr.nlc = hHttpsConnection;
diff --git a/protocols/MSN/src/msn_commands.cpp b/protocols/MSN/src/msn_commands.cpp index 0f3cd8db04..e4fc9428e1 100644 --- a/protocols/MSN/src/msn_commands.cpp +++ b/protocols/MSN/src/msn_commands.cpp @@ -145,7 +145,7 @@ void CMsnProto::MSN_ReceiveMessage(ThreadData* info, char* cmdString, char* para buf.AppendFormat("Ack-Id: %s\r\n", tHeader["Ack-Id"]);
if (msnRegistration) buf.AppendFormat("Registration: %s\r\n", msnRegistration);
buf.AppendFormat("\r\n");
- msnNsThread->sendPacket("ACK", "MSGR %d\r\n%s", strlen(buf), buf);
+ msnNsThread->sendPacket("ACK", "MSGR %d\r\n%s", mir_strlen(buf), buf);
}
msgBody = tHeader.readFromBuffer(msgBody);
if (!(email = NEWSTR_ALLOCA(tHeader["From"]))) return;
@@ -173,7 +173,7 @@ void CMsnProto::MSN_ReceiveMessage(ThreadData* info, char* cmdString, char* para if (tChunks)
idx = addCachedMsg(tMsgId, msg, 0, msgBytes, atol(tChunks), true);
else
- idx = addCachedMsg(tMsgId, msgBody, 0, strlen(msgBody), 0, true);
+ idx = addCachedMsg(tMsgId, msgBody, 0, mir_strlen(msgBody), 0, true);
size_t newsize;
if (!getCachedMsg(idx, newbody, newsize)) return;
@@ -214,7 +214,7 @@ void CMsnProto::MSN_ReceiveMessage(ThreadData* info, char* cmdString, char* para MCONTACT hContact = strncmp(email, "19:", 3)?MSN_HContactFromEmail(email, nick, true, true):NULL;
if (!_stricmp(tHeader["Message-Type"], "RichText/Contacts")) {
- ezxml_t xmli = ezxml_parse_str(msgBody, strlen(msgBody));
+ ezxml_t xmli = ezxml_parse_str(msgBody, mir_strlen(msgBody));
if (xmli) {
if (!strcmp(xmli->name, "contacts")) {
ezxml_t c;
@@ -275,7 +275,7 @@ void CMsnProto::MSN_ReceiveMessage(ThreadData* info, char* cmdString, char* para const char* tP4Context = tHeader["P4-Context"];
if (tP4Context) {
- size_t newlen = strlen(msgBody) + strlen(tP4Context) + 4;
+ size_t newlen = mir_strlen(msgBody) + mir_strlen(tP4Context) + 4;
char* newMsgBody = (char*)mir_alloc(newlen);
mir_snprintf(newMsgBody, newlen, "[%s] %s", tP4Context, msgBody);
mir_free(newbody);
@@ -284,7 +284,7 @@ void CMsnProto::MSN_ReceiveMessage(ThreadData* info, char* cmdString, char* para if (mChatID[0]) {
if (!_strnicmp(tHeader["Message-Type"], "ThreadActivity/", 15)) {
- ezxml_t xmli = ezxml_parse_str(msgBody, strlen(msgBody));
+ ezxml_t xmli = ezxml_parse_str(msgBody, mir_strlen(msgBody));
if (xmli) {
MSN_GCProcessThreadActivity(xmli, mChatID);
ezxml_free(xmli);
@@ -312,7 +312,7 @@ void CMsnProto::MSN_ReceiveMessage(ThreadData* info, char* cmdString, char* para dbei.flags = DBEF_SENT | DBEF_UTF | (haveWnd ? 0 : DBEF_READ) | (isRtl ? DBEF_RTL : 0);
dbei.szModule = m_szModuleName;
dbei.timestamp = time(NULL);
- dbei.cbBlob = (unsigned)strlen(msgBody) + 1;
+ dbei.cbBlob = (unsigned)mir_strlen(msgBody) + 1;
dbei.pBlob = (PBYTE)msgBody;
db_event_add(hContact, &dbei);
}
@@ -680,14 +680,14 @@ void CMsnProto::MSN_ProcessStatusMessage(ezxml_t xmli, const char* wlid) size_t lenPart = mir_snprintf(part, SIZEOF(part), "{%d}", i - 4);
if (parts[i][0] == '\0' && unknown != NULL)
parts[i] = unknown;
- size_t lenPartsI = strlen(parts[i]);
+ size_t lenPartsI = mir_strlen(parts[i]);
for (p = strstr(format, part); p; p = strstr(p + lenPartsI, part)) {
if (lenPart < lenPartsI) {
int loc = p - format;
- format = (char *)mir_realloc(format, strlen(format) + (lenPartsI - lenPart) + 1);
+ format = (char *)mir_realloc(format, mir_strlen(format) + (lenPartsI - lenPart) + 1);
p = format + loc;
}
- memmove(p + lenPartsI, p + lenPart, strlen(p + lenPart) + 1);
+ memmove(p + lenPartsI, p + lenPart, mir_strlen(p + lenPart) + 1);
memmove(p, parts[i], lenPartsI);
}
}
@@ -827,7 +827,7 @@ LBL_InvalidCommand: "<epid>%.*s</epid></msgr>\r\n",
msnP24Ver, (msnP24Ver>1?"<altVersions><ver>1</ver></altVersions>":""),
msnStoreAppId, msnProductVer,
- strlen(MyOptions.szMachineGuid)-2, MyOptions.szMachineGuid+1);
+ mir_strlen(MyOptions.szMachineGuid)-2, MyOptions.szMachineGuid+1);
bSentBND = true;
}
else
@@ -859,7 +859,7 @@ LBL_InvalidCommand: replaceStr(msnRegistration,tHeader["Set-Registration"]);
if (!strcmp(data.typeId, "CON")) {
- ezxml_t xmlbnd = ezxml_parse_str(msgBody, strlen(msgBody));
+ ezxml_t xmlbnd = ezxml_parse_str(msgBody, mir_strlen(msgBody));
ezxml_t xmlbdy = ezxml_child(xmlbnd, "nonce");
if (xmlbdy)
{
@@ -920,7 +920,7 @@ LBL_InvalidCommand: } else {
/* Skype username/pass login */
- ezxml_t xmlcnt = ezxml_parse_str(msgBody, strlen(msgBody));
+ ezxml_t xmlcnt = ezxml_parse_str(msgBody, mir_strlen(msgBody));
ezxml_t xmlnonce = ezxml_child(xmlcnt, "nonce");
if (xmlnonce) {
char szUIC[1024]={0};
@@ -958,7 +958,7 @@ LBL_InvalidCommand: ezxml_t xmli;
if (tHeader["Set-Registration"]) replaceStr(msnRegistration,tHeader["Set-Registration"]);
- if (xmli = ezxml_parse_str(msgBody, strlen(msgBody)))
+ if (xmli = ezxml_parse_str(msgBody, mir_strlen(msgBody)))
{
if (!strcmp(xmli->name, "recentconversations-response"))
{
@@ -1027,7 +1027,7 @@ LBL_InvalidCommand: stripHTML(message);
HtmlDecode(message);
} else if (!strncmp(msgtype->txt, "ThreadActivity/", 15)) {
- if (ezxml_t xmlact = ezxml_parse_str(content->txt, strlen(content->txt))) {
+ if (ezxml_t xmlact = ezxml_parse_str(content->txt, mir_strlen(content->txt))) {
MSN_GCProcessThreadActivity(xmlact, _A2T(id->txt));
ezxml_free(xmlact);
}
@@ -1046,7 +1046,7 @@ LBL_InvalidCommand: MEVENT hDbEvent;
bool bDuplicate = false;
DBEVENTINFO dbei = { sizeof(dbei) };
- DWORD cbBlob = (DWORD)strlen(message);
+ DWORD cbBlob = (DWORD)mir_strlen(message);
dbei.cbBlob = cbBlob;
BYTE *pszMsgBuf = (BYTE*)mir_calloc(cbBlob);
if (pszMsgBuf) {
@@ -1076,7 +1076,7 @@ LBL_InvalidCommand: dbei.flags = DBEF_SENT | DBEF_UTF;
dbei.szModule = m_szModuleName;
dbei.timestamp = ts;
- dbei.cbBlob = (unsigned)strlen(message) + 1;
+ dbei.cbBlob = (unsigned)mir_strlen(message) + 1;
dbei.pBlob = (PBYTE)message;
db_event_add(hContact, &dbei);
}
@@ -1122,7 +1122,7 @@ LBL_InvalidCommand: } else if (!strcmp(data.typeId, "MSGR\\ABCH")) {
MimeHeaders tHeader;
msgBody = tHeader.readFromBuffer(msgBody);
- MSN_ProcessNotificationMessage(msgBody, strlen(msgBody));
+ MSN_ProcessNotificationMessage(msgBody, mir_strlen(msgBody));
break;
}
@@ -1139,7 +1139,7 @@ LBL_InvalidCommand: if (pszFrom)
{
ezxml_t xmli;
- if (xmli = ezxml_parse_str(msgBody, strlen(msgBody)))
+ if (xmli = ezxml_parse_str(msgBody, mir_strlen(msgBody)))
{
if (!strcmp(xmli->name, "user"))
{
@@ -1164,7 +1164,7 @@ LBL_InvalidCommand: char *msgBody = tHeader.readFromBuffer(info->mData);
ezxml_t xmli;
- if (xmli = ezxml_parse_str(msgBody, strlen(msgBody)))
+ if (xmli = ezxml_parse_str(msgBody, mir_strlen(msgBody)))
{
MSN_ChatStart(xmli);
ezxml_free(xmli);
@@ -1190,7 +1190,7 @@ LBL_InvalidCommand: if (tHeader["Set-Registration"]) replaceStr(msnRegistration,tHeader["Set-Registration"]);
if (cmdString[1]=='N') { // PNG
- if (ezxml_t xmli = ezxml_parse_str(msgBody, strlen(msgBody))) {
+ if (ezxml_t xmli = ezxml_parse_str(msgBody, mir_strlen(msgBody))) {
if (ezxml_t wait = ezxml_child(xmli, "wait")) {
msnPingTimeout = atoi(ezxml_txt(wait));
if (msnPingTimeout && hKeepAliveThreadEvt != NULL)
@@ -1200,7 +1200,7 @@ LBL_InvalidCommand: }
} else { // PUT
ezxml_t xmli;
- if (*msgBody && (xmli = ezxml_parse_str(msgBody, strlen(msgBody)))) {
+ if (*msgBody && (xmli = ezxml_parse_str(msgBody, mir_strlen(msgBody)))) {
if (!strcmp(xmli->name, "presence-response")) {
ezxml_t user, from;
if ((user = ezxml_child(xmli, "user")) && (from = ezxml_child(xmli, "from"))) {
@@ -1239,7 +1239,7 @@ LBL_InvalidCommand: HReadBuffer buf(info, 0);
char* msgBody = tHeader.readFromBuffer((char*)buf.surelyRead(atol(data.strMsgBytes)));
if (!strcmp(data.typeId, "CON")) {
- ezxml_t xmlxfr = ezxml_parse_str(msgBody, strlen(msgBody));
+ ezxml_t xmlxfr = ezxml_parse_str(msgBody, mir_strlen(msgBody));
ezxml_t xmltgt = ezxml_child(xmlxfr, "target");
if (xmltgt)
{
@@ -1514,7 +1514,7 @@ void CMsnProto::MSN_CustomSmiley(const char* msgBody, char* email, char* nick, i memcpy(ft->p2p_object, tok1, sz);
ft->p2p_object[sz] = 0;
- size_t slen = strlen(lastsml);
+ size_t slen = mir_strlen(lastsml);
ptrA buf(mir_base64_encode((PBYTE)lastsml, (unsigned)slen));
ptrA smileyName(mir_urlEncode(buf));
diff --git a/protocols/MSN/src/msn_ftold.cpp b/protocols/MSN/src/msn_ftold.cpp index dfd2e296c7..f30b06bb66 100644 --- a/protocols/MSN/src/msn_ftold.cpp +++ b/protocols/MSN/src/msn_ftold.cpp @@ -37,7 +37,7 @@ void CMsnProto::msnftp_sendAcceptReject(filetransfer *ft, bool acc) "Invitation-Cookie: %s\r\n"
"Launch-Application: FALSE\r\n"
"Request-Data: IP-Address:\r\n\r\n",
- 172 + 4 + strlen(ft->szInvcookie), ft->szInvcookie);
+ 172 + 4 + mir_strlen(ft->szInvcookie), ft->szInvcookie);
}
else {
thread->sendPacket("MSG",
@@ -46,7 +46,7 @@ void CMsnProto::msnftp_sendAcceptReject(filetransfer *ft, bool acc) "Invitation-Command: CANCEL\r\n"
"Invitation-Cookie: %s\r\n"
"Cancel-Code: REJECT\r\n\r\n",
- 172 - 33 + 4 + strlen(ft->szInvcookie), ft->szInvcookie);
+ 172 - 33 + 4 + mir_strlen(ft->szInvcookie), ft->szInvcookie);
}
}
@@ -181,7 +181,7 @@ LBL_InvalidCommand: }
else if (info->mCaller == 2) { //send
static const char sttCommand[] = "VER MSNFTP\r\n";
- info->send(sttCommand, strlen(sttCommand));
+ info->send(sttCommand, mir_strlen(sttCommand));
}
break;
@@ -210,7 +210,7 @@ LBL_Error: if (tIsTransitionFinished) {
LBL_Success:
static const char sttCommand[] = "BYE 16777989\r\n";
- info->send(sttCommand, strlen(sttCommand));
+ info->send(sttCommand, mir_strlen(sttCommand));
return 1;
}
diff --git a/protocols/MSN/src/msn_libstr.cpp b/protocols/MSN/src/msn_libstr.cpp index a77a343a2d..f67299fa4c 100644 --- a/protocols/MSN/src/msn_libstr.cpp +++ b/protocols/MSN/src/msn_libstr.cpp @@ -63,7 +63,7 @@ bool txtParseParam(const char* szData, const char* presearch, const char* start, cp = strstr(cp1, start);
if (cp == NULL) return false;
- cp += strlen(start);
+ cp += mir_strlen(start);
while (*cp == ' ') ++cp;
if (finish) {
@@ -338,7 +338,7 @@ char* getNewUuid(void) BYTE *p;
UuidToStringA(&id, &p);
- size_t len = strlen((char*)p) + 3;
+ size_t len = mir_strlen((char*)p) + 3;
char *result = (char*)mir_alloc(len);
mir_snprintf(result, len, "{%s}", p);
_strupr(result);
diff --git a/protocols/MSN/src/msn_mail.cpp b/protocols/MSN/src/msn_mail.cpp index 77d5d9600c..984e8fe8b2 100644 --- a/protocols/MSN/src/msn_mail.cpp +++ b/protocols/MSN/src/msn_mail.cpp @@ -45,7 +45,7 @@ ezxml_t CMsnProto::oimRecvHdr(const char* service, ezxml_t& tbdy, char*& httphdr tbdy = ezxml_add_child(bdy, service, 0);
ezxml_set_attr(tbdy, "xmlns", "http://www.hotmail.msn.com/ws/2004/09/oim/rsi");
- size_t hdrsz = strlen(service) + sizeof(mailReqHdr) + 20;
+ size_t hdrsz = mir_strlen(service) + sizeof(mailReqHdr) + 20;
httphdr = (char*)mir_alloc(hdrsz);
mir_snprintf(httphdr, hdrsz, mailReqHdr, service);
@@ -88,7 +88,7 @@ void CMsnProto::getOIMs(ezxml_t xmli) mir_free(url);
if (tResult != NULL && status == 200) {
- ezxml_t xmlm = ezxml_parse_str(tResult, strlen(tResult));
+ ezxml_t xmlm = ezxml_parse_str(tResult, mir_strlen(tResult));
ezxml_t body = getSoapResponse(xmlm, "GetMessage");
MimeHeaders mailInfo;
@@ -168,7 +168,7 @@ void CMsnProto::getMetaData(void) mir_free(getReqHdr);
if (tResult != NULL && status == 200) {
- ezxml_t xmlm = ezxml_parse_str(tResult, strlen(tResult));
+ ezxml_t xmlm = ezxml_parse_str(tResult, mir_strlen(tResult));
ezxml_t xmli = ezxml_get(xmlm, "s:Body", 0, "GetMetadataResponse", 0, "MD", -1);
if (!xmli)
xmli = ezxml_get(xmlm, "soap:Body", 0, "GetMetadataResponse", 0, "MD", -1);
@@ -186,7 +186,7 @@ void CMsnProto::processMailData(char* mailData) getMetaData();
}
else {
- ezxml_t xmli = ezxml_parse_str(mailData, strlen(mailData));
+ ezxml_t xmli = ezxml_parse_str(mailData, mir_strlen(mailData));
ezxml_t toke = ezxml_child(xmli, "E");
@@ -357,7 +357,7 @@ void CMsnProto::sttNotificationMessage(char* msgBody, bool isInitial) static void TruncUtf8(char *str, size_t sz)
{
- size_t len = strlen(str);
+ size_t len = mir_strlen(str);
if (sz > len) sz = len;
size_t cntl = 0, cnt = 0;
diff --git a/protocols/MSN/src/msn_menu.cpp b/protocols/MSN/src/msn_menu.cpp index fc1eb5441d..c596f06b87 100644 --- a/protocols/MSN/src/msn_menu.cpp +++ b/protocols/MSN/src/msn_menu.cpp @@ -274,7 +274,7 @@ void CMsnProto::MsnInitMainMenu(void) {
char servicefunction[100];
strcpy(servicefunction, m_szModuleName);
- char* tDest = servicefunction + strlen(servicefunction);
+ char* tDest = servicefunction + mir_strlen(servicefunction);
CLISTMENUITEM mi = { sizeof(mi) };
@@ -410,7 +410,7 @@ void MSN_InitContactMenu(void) {
char servicefunction[100];
strcpy(servicefunction, "MSN");
- char* tDest = servicefunction + strlen(servicefunction);
+ char* tDest = servicefunction + mir_strlen(servicefunction);
CLISTMENUITEM mi = { sizeof(mi) };
mi.pszService = servicefunction;
diff --git a/protocols/MSN/src/msn_mime.cpp b/protocols/MSN/src/msn_mime.cpp index 9a60356ab1..7545c5759d 100644 --- a/protocols/MSN/src/msn_mime.cpp +++ b/protocols/MSN/src/msn_mime.cpp @@ -111,7 +111,7 @@ void MimeHeaders::addBool(const char* name, bool lValue) char* MimeHeaders::flipStr(const char* src, size_t len, char* dest)
{
- if (len == -1) len = strlen(src);
+ if (len == -1) len = mir_strlen(src);
if (src == dest) {
const unsigned b = (unsigned)len-- / 2;
@@ -139,7 +139,7 @@ size_t MimeHeaders::getLength(void) size_t iResult = 0;
for (unsigned i = 0; i < mCount; i++) {
MimeHeader& H = mVals[i];
- iResult += strlen(H.name) + strlen(H.value) + 4;
+ iResult += mir_strlen(H.name) + mir_strlen(H.value) + 4;
}
return iResult + (iResult ? 2 : 0);
@@ -219,7 +219,7 @@ const char* MimeHeaders::find(const char* szFieldName) return MH.value;
}
- const size_t len = strlen(szFieldName);
+ const size_t len = mir_strlen(szFieldName);
char* szFieldNameR = (char*)alloca(len + 1);
flipStr(szFieldName, len, szFieldNameR);
@@ -400,7 +400,7 @@ static size_t utf8toutf16(char* str, wchar_t* res) wchar_t* MimeHeaders::decode(const char* val)
{
- size_t ssz = strlen(val) * 2 + 1;
+ size_t ssz = mir_strlen(val) * 2 + 1;
char* tbuf = (char*)alloca(ssz);
memcpy(tbuf, val, ssz);
diff --git a/protocols/MSN/src/msn_misc.cpp b/protocols/MSN/src/msn_misc.cpp index ff7e203847..fcf168788d 100644 --- a/protocols/MSN/src/msn_misc.cpp +++ b/protocols/MSN/src/msn_misc.cpp @@ -89,13 +89,13 @@ void CMsnProto::MSN_AddAuthRequest(const char *email, const char *nick, const ch MCONTACT hContact = MSN_HContactFromEmail(email, nick, true, true);
- int emaillen = (int)strlen(email);
+ int emaillen = (int)mir_strlen(email);
if (nick == NULL) nick = "";
- int nicklen = (int)strlen(nick);
+ int nicklen = (int)mir_strlen(nick);
if (reason == NULL) reason = "";
- int reasonlen = (int)strlen(reason);
+ int reasonlen = (int)mir_strlen(reason);
PROTORECVEVENT pre = { 0 };
pre.timestamp = (DWORD)time(NULL);
@@ -139,7 +139,7 @@ char* MSN_GetAvatarHash(char* szContext, char** pszUrl) char *res = NULL;
- ezxml_t xmli = ezxml_parse_str(NEWSTR_ALLOCA(szContext), strlen(szContext));
+ ezxml_t xmli = ezxml_parse_str(NEWSTR_ALLOCA(szContext), mir_strlen(szContext));
const char *szAvatarHash = ezxml_attr(xmli, "SHA1D");
if (szAvatarHash != NULL) {
unsigned hashLen;
@@ -248,13 +248,13 @@ int CMsnProto::MSN_SetMyAvatar(const TCHAR* sztFname, void* pData, size_t cbLen) ezxml_t xmlp = ezxml_new("msnobj");
mir_sha1_append(&sha1ctx, (PBYTE)"Creator", 7);
- mir_sha1_append(&sha1ctx, (PBYTE)MyOptions.szEmail, (int)strlen(MyOptions.szEmail));
+ mir_sha1_append(&sha1ctx, (PBYTE)MyOptions.szEmail, (int)mir_strlen(MyOptions.szEmail));
ezxml_set_attr(xmlp, "Creator", MyOptions.szEmail);
char szFileSize[20];
_ultoa((unsigned)cbLen, szFileSize, 10);
mir_sha1_append(&sha1ctx, (PBYTE)"Size", 4);
- mir_sha1_append(&sha1ctx, (PBYTE)szFileSize, (int)strlen(szFileSize));
+ mir_sha1_append(&sha1ctx, (PBYTE)szFileSize, (int)mir_strlen(szFileSize));
ezxml_set_attr(xmlp, "Size", szFileSize);
mir_sha1_append(&sha1ctx, (PBYTE)"Type", 4);
@@ -262,7 +262,7 @@ int CMsnProto::MSN_SetMyAvatar(const TCHAR* sztFname, void* pData, size_t cbLen) ezxml_set_attr(xmlp, "Type", "3");
mir_sha1_append(&sha1ctx, (PBYTE)"Location", 8);
- mir_sha1_append(&sha1ctx, (PBYTE)szFname, (int)strlen(szFname));
+ mir_sha1_append(&sha1ctx, (PBYTE)szFname, (int)mir_strlen(szFname));
ezxml_set_attr(xmlp, "Location", szFname);
mir_sha1_append(&sha1ctx, (PBYTE)"Friendly", 8);
@@ -270,7 +270,7 @@ int CMsnProto::MSN_SetMyAvatar(const TCHAR* sztFname, void* pData, size_t cbLen) ezxml_set_attr(xmlp, "Friendly", "AAA=");
mir_sha1_append(&sha1ctx, (PBYTE)"SHA1D", 5);
- mir_sha1_append(&sha1ctx, (PBYTE)(char*)szSha1d, (int)strlen(szSha1d));
+ mir_sha1_append(&sha1ctx, (PBYTE)(char*)szSha1d, (int)mir_strlen(szSha1d));
ezxml_set_attr(xmlp, "SHA1D", szSha1d);
mir_sha1_finish(&sha1ctx, sha1c);
@@ -506,7 +506,7 @@ int ThreadData::sendMessage(int msgType, const char* email, int netId, const cha pszMsgType,
pszNick,
pszContType,
- strlen(parMsg));
+ mir_strlen(parMsg));
if (*tFontName) buf.AppendFormat("X-MMS-IM-Format: FN=%s; EF=%s; CO=%x; CS=0; PF=31%s\r\n",
tFontName, tFontStyle, tFontColor, (parFlags & MSG_RTL) ? ";RL=1" : "");
@@ -530,10 +530,10 @@ int ThreadData::sendMessage(int msgType, const char* email, int netId, const cha #ifdef OBSOLETE
if (netId == NETID_YAHOO || netId == NETID_MOB || (parFlags & MSG_OFFLINE))
seq = sendPacket("UUM", "%s %d %c %d\r\n%s%s", email, netId, msgType,
- strlen(parMsg) + off, buf, parMsg);
+ mir_strlen(parMsg) + off, buf, parMsg);
else
seq = sendPacket("MSG", "%c %d\r\n%s%s", msgType,
- strlen(parMsg) + off, buf, parMsg);
+ mir_strlen(parMsg) + off, buf, parMsg);
#endif
return seq;
@@ -571,7 +571,7 @@ int ThreadData::sendRawMessage(int msgType, const char* data, int datLen) data = "";
if (datLen == -1)
- datLen = (int)strlen(data);
+ datLen = (int)mir_strlen(data);
char* buf = (char*)alloca(datLen + 100);
@@ -732,7 +732,7 @@ int ThreadData::sendPacket(const char* cmd, const char* fmt, ...) if (strchr(str, '\r') == NULL)
strcat(str, "\r\n");
- int result = send(str, strlen(str));
+ int result = send(str, mir_strlen(str));
mir_free(str);
return (result > 0) ? thisTrid : -1;
}
@@ -750,7 +750,7 @@ int ThreadData::sendPacketPayload(const char* cmd, const char *param, const char va_start(vararg, fmt);
thisTrid = InterlockedIncrement(&mTrid);
- int regSz = proto->msnRegistration ? (int)strlen(proto->msnRegistration)+16 : 0;
+ int regSz = proto->msnRegistration ? (int)mir_strlen(proto->msnRegistration)+16 : 0;
int paramStart = mir_snprintf(str, strsize, "%s %d %s ", cmd, thisTrid, param), strszstart = 0, strSz;
while ((strSz = mir_vsnprintf(str + paramStart, strsize - paramStart - regSz - 10, fmt, vararg)) == -1)
str = (char*)mir_realloc(str, strsize += 512);
@@ -762,7 +762,7 @@ int ThreadData::sendPacketPayload(const char* cmd, const char *param, const char str[strsize - 3] = 0;
va_end(vararg);
- int result = send(str, strlen(str));
+ int result = send(str, mir_strlen(str));
mir_free(str);
return (result > 0) ? thisTrid : -1;
}
@@ -1257,7 +1257,7 @@ char* directconnection::calcHashedNonce(UUID* nonce) char* p;
UuidToStringA((UUID*)&sha, (BYTE**)&p);
- size_t len = strlen(p) + 3;
+ size_t len = mir_strlen(p) + 3;
char* result = (char*)mir_alloc(len);
mir_snprintf(result, len, "{%s}", p);
_strupr(result);
@@ -1270,7 +1270,7 @@ char* directconnection::mNonceToText(void) {
char* p;
UuidToStringA(mNonce, (BYTE**)&p);
- size_t len = strlen(p) + 3;
+ size_t len = mir_strlen(p) + 3;
char* result = (char*)mir_alloc(len);
mir_snprintf(result, len, "{%s}", p);
_strupr(result);
@@ -1282,7 +1282,7 @@ char* directconnection::mNonceToText(void) void directconnection::xNonceToBin(UUID* nonce)
{
- size_t len = strlen(xNonce);
+ size_t len = mir_strlen(xNonce);
char *p = (char*)alloca(len);
strcpy(p, xNonce + 1);
p[len - 2] = 0;
@@ -1377,8 +1377,8 @@ void MSN_MakeDigest(const char* chl, char* dgst) DWORD md5hash[4], md5hashOr[4];
mir_md5_state_t context;
mir_md5_init(&context);
- mir_md5_append(&context, (BYTE*)chl, (int)strlen(chl));
- mir_md5_append(&context, (BYTE*)msnProtChallenge, (int)strlen(msnProtChallenge));
+ mir_md5_append(&context, (BYTE*)chl, (int)mir_strlen(chl));
+ mir_md5_append(&context, (BYTE*)msnProtChallenge, (int)mir_strlen(msnProtChallenge));
mir_md5_finish(&context, (BYTE*)md5hash);
memcpy(md5hashOr, md5hash, sizeof(md5hash));
@@ -1389,11 +1389,11 @@ void MSN_MakeDigest(const char* chl, char* dgst) char chlString[128];
mir_snprintf(chlString, SIZEOF(chlString), "%s%s00000000", chl, msnProductID);
- chlString[(strlen(chl) + strlen(msnProductID) + 7) & 0xF8] = 0;
+ chlString[(mir_strlen(chl) + mir_strlen(msnProductID) + 7) & 0xF8] = 0;
LONGLONG high = 0, low = 0;
int* chlStringArray = (int*)chlString;
- for (i = 0; i < strlen(chlString) / 4; i += 2) {
+ for (i = 0; i < mir_strlen(chlString) / 4; i += 2) {
LONGLONG temp = chlStringArray[i];
temp = (0x0E79A9C1 * temp) % 0x7FFFFFFF;
diff --git a/protocols/MSN/src/msn_opts.cpp b/protocols/MSN/src/msn_opts.cpp index e512463499..08565ce654 100644 --- a/protocols/MSN/src/msn_opts.cpp +++ b/protocols/MSN/src/msn_opts.cpp @@ -182,7 +182,7 @@ static INT_PTR CALLBACK DlgProcMsnOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP char* p = strchr(szFile + 1, '\"');
if (p != NULL) {
*p = '\0';
- memmove(szFile, szFile + 1, strlen(szFile));
+ memmove(szFile, szFile + 1, mir_strlen(szFile));
tSelectLen += 2;
goto LBL_Continue;
}
@@ -191,7 +191,7 @@ static INT_PTR CALLBACK DlgProcMsnOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP char* p = strchr(szFile, ' ');
if (p != NULL) *p = '\0';
LBL_Continue:
- tSelectLen += strlen(szFile);
+ tSelectLen += mir_strlen(szFile);
OPENFILENAMEA ofn = { 0 };
ofn.lStructSize = sizeof(ofn);
diff --git a/protocols/MSN/src/msn_p2p.cpp b/protocols/MSN/src/msn_p2p.cpp index 06f90bb63b..fcba3a8e3f 100644 --- a/protocols/MSN/src/msn_p2p.cpp +++ b/protocols/MSN/src/msn_p2p.cpp @@ -1158,8 +1158,8 @@ void CMsnProto::p2p_InitFileTransfer( if (pictmatch) {
UrlDecode(dbv.pszVal);
- ezxml_t xmlcon = ezxml_parse_str((char*)szContext, strlen(szContext));
- ezxml_t xmldb = ezxml_parse_str(dbv.pszVal, strlen(dbv.pszVal));
+ ezxml_t xmlcon = ezxml_parse_str((char*)szContext, mir_strlen(szContext));
+ ezxml_t xmldb = ezxml_parse_str(dbv.pszVal, mir_strlen(dbv.pszVal));
const char *szCtBuf = ezxml_attr(xmlcon, "SHA1C");
if (szCtBuf) {
@@ -2051,7 +2051,7 @@ void CMsnProto::p2p_invite(unsigned iAppID, filetransfer* ft, const char *wlid) return;
}
- ezxml_t xmlo = ezxml_parse_str(NEWSTR_ALLOCA(ft->p2p_object), strlen(ft->p2p_object));
+ ezxml_t xmlo = ezxml_parse_str(NEWSTR_ALLOCA(ft->p2p_object), mir_strlen(ft->p2p_object));
ezxml_t xmlr = ezxml_new("msnobj");
const char* p;
@@ -2080,7 +2080,7 @@ void CMsnProto::p2p_invite(unsigned iAppID, filetransfer* ft, const char *wlid) ezxml_set_attr(xmlr, "SHA1C", p);
pContext = ezxml_toxml(xmlr, false);
- cbContext = strlen(pContext) + 1;
+ cbContext = mir_strlen(pContext) + 1;
ezxml_free(xmlr);
ezxml_free(xmlo);
diff --git a/protocols/MSN/src/msn_proto.cpp b/protocols/MSN/src/msn_proto.cpp index a49e3bca54..8e1eebc17f 100644 --- a/protocols/MSN/src/msn_proto.cpp +++ b/protocols/MSN/src/msn_proto.cpp @@ -271,9 +271,9 @@ MCONTACT __cdecl CMsnProto::AddToListByEvent(int flags, int, MEVENT hDbEvent) if (dbei.eventType != EVENTTYPE_AUTHREQUEST) return NULL;
char* nick = (char *)(dbei.pBlob + sizeof(DWORD) * 2);
- char* firstName = nick + strlen(nick) + 1;
- char* lastName = firstName + strlen(firstName) + 1;
- char* email = lastName + strlen(lastName) + 1;
+ char* firstName = nick + mir_strlen(nick) + 1;
+ char* lastName = firstName + mir_strlen(firstName) + 1;
+ char* email = lastName + mir_strlen(lastName) + 1;
return AddToListByEmail(email, nick, flags);
}
@@ -335,9 +335,9 @@ int CMsnProto::Authorize(MEVENT hDbEvent) return 1;
char *nick = (char*)(dbei.pBlob + sizeof(DWORD) * 2);
- char *firstName = nick + strlen(nick) + 1;
- char *lastName = firstName + strlen(firstName) + 1;
- char *email = lastName + strlen(lastName) + 1;
+ char *firstName = nick + mir_strlen(nick) + 1;
+ char *lastName = firstName + mir_strlen(firstName) + 1;
+ char *email = lastName + mir_strlen(lastName) + 1;
MCONTACT hContact = MSN_HContactFromEmail(email, nick, true, 0);
int netId = Lists_GetNetId(email);
@@ -373,9 +373,9 @@ int CMsnProto::AuthDeny(MEVENT hDbEvent, const TCHAR*) return 1;
char* nick = (char*)(dbei.pBlob + sizeof(DWORD) * 2);
- char* firstName = nick + strlen(nick) + 1;
- char* lastName = firstName + strlen(firstName) + 1;
- char* email = lastName + strlen(lastName) + 1;
+ char* firstName = nick + mir_strlen(nick) + 1;
+ char* lastName = firstName + mir_strlen(firstName) + 1;
+ char* email = lastName + mir_strlen(lastName) + 1;
MsnContact* msc = Lists_Get(email);
if (msc == NULL) return 0;
@@ -833,7 +833,7 @@ int __cdecl CMsnProto::SendMsg(MCONTACT hContact, int flags, const char* pszSrc) switch (netId) {
case NETID_MOB:
- if (strlen(msg) > 133) {
+ if (mir_strlen(msg) > 133) {
errMsg = Translate("Message is too long: SMS page limited to 133 UTF8 chars");
seq = 999997;
}
@@ -845,7 +845,7 @@ int __cdecl CMsnProto::SendMsg(MCONTACT hContact, int flags, const char* pszSrc) break;
case NETID_YAHOO:
- if (strlen(msg) > 1202) {
+ if (mir_strlen(msg) > 1202) {
seq = 999996;
errMsg = Translate("Message is too long: MSN messages are limited by 1202 UTF8 chars");
ForkThread(&CMsnProto::MsnFakeAck, new TFakeAckParams(hContact, seq, errMsg, this));
@@ -857,7 +857,7 @@ int __cdecl CMsnProto::SendMsg(MCONTACT hContact, int flags, const char* pszSrc) break;
default:
- if (strlen(msg) > 1202) {
+ if (mir_strlen(msg) > 1202) {
seq = 999996;
errMsg = Translate("Message is too long: MSN messages are limited by 1202 UTF8 chars");
ForkThread(&CMsnProto::MsnFakeAck, new TFakeAckParams(hContact, seq, errMsg, this));
@@ -940,7 +940,7 @@ int __cdecl CMsnProto::SetAwayMsg(int status, const TCHAR* msg) mir_free(*msgptr);
char* buf = *msgptr = mir_utf8encodeT(msg);
- if (buf && strlen(buf) > 1859) {
+ if (buf && mir_strlen(buf) > 1859) {
buf[1859] = 0;
const int i = 1858;
if (buf[i] & 128) {
diff --git a/protocols/MSN/src/msn_soapab.cpp b/protocols/MSN/src/msn_soapab.cpp index 073d8ac3aa..ec01f9a0ee 100644 --- a/protocols/MSN/src/msn_soapab.cpp +++ b/protocols/MSN/src/msn_soapab.cpp @@ -64,7 +64,7 @@ ezxml_t CMsnProto::abSoapHdr(const char* service, const char* scenario, ezxml_t& ezxml_set_txt(node, "00000000-0000-0000-0000-000000000000");
}
- size_t hdrsz = strlen(service) + sizeof(abReqHdr) + 20;
+ size_t hdrsz = mir_strlen(service) + sizeof(abReqHdr) + 20;
httphdr = (char*)mir_alloc(hdrsz);
mir_snprintf(httphdr, hdrsz, abReqHdr, service);
@@ -161,7 +161,7 @@ bool CMsnProto::MSN_ABAdd(bool allowRecurse) if (tResult != NULL) {
UpdateABHost("ABAdd", abUrl);
- ezxml_t xmlm = ezxml_parse_str(tResult, strlen(tResult));
+ ezxml_t xmlm = ezxml_parse_str(tResult, mir_strlen(tResult));
if (status == 500) {
const char* szErr = ezxml_txt(getSoapFault(xmlm, true));
if (strcmp(szErr, "PassportAuthFail") == 0 && allowRecurse) {
@@ -239,7 +239,7 @@ bool CMsnProto::MSN_SharingFindMembership(bool deltas, bool allowRecurse) free(szData);
if (tResult != NULL) {
- ezxml_t xmlm = ezxml_parse_str(tResult, strlen(tResult));
+ ezxml_t xmlm = ezxml_parse_str(tResult, mir_strlen(tResult));
if (status == 200) {
UpdateABCacheKey(xmlm, true);
ezxml_t body = getSoapResponse(xmlm, "FindMembership");
@@ -425,7 +425,7 @@ bool CMsnProto::MSN_SharingAddDelMember(const char* szEmail, const int listId, c if (tResult != NULL) {
UpdateABHost(szMethod, abUrl);
- ezxml_t xmlm = ezxml_parse_str(tResult, strlen(tResult));
+ ezxml_t xmlm = ezxml_parse_str(tResult, mir_strlen(tResult));
UpdateABCacheKey(xmlm, true);
if (status == 500) {
const char* szErr = ezxml_txt(getSoapFault(xmlm, true));
@@ -503,7 +503,7 @@ bool CMsnProto::MSN_SharingMyProfile(bool allowRecurse) mir_free(reqHdr);
free(szData);
- ezxml_t xmlm = ezxml_parse_str(tResult, strlen(tResult));
+ ezxml_t xmlm = ezxml_parse_str(tResult, mir_strlen(tResult));
if (status == 500) {
const char* szErr = ezxml_txt(getSoapFault(xmlm, true));
if (strcmp(szErr, "PassportAuthFail") == 0 && allowRecurse) {
@@ -617,7 +617,7 @@ bool CMsnProto::MSN_ABFind(const char* szMethod, const char* szGuid, bool deltas free(szData);
if (tResult != NULL) {
- ezxml_t xmlm = ezxml_parse_str(tResult, strlen(tResult));
+ ezxml_t xmlm = ezxml_parse_str(tResult, mir_strlen(tResult));
UpdateABCacheKey(xmlm, false);
if (status == 200) {
@@ -842,7 +842,7 @@ bool CMsnProto::MSN_ABFind(const char* szMethod, const char* szGuid, bool deltas }
if (!msnLoggedIn && msnNsThread) {
char *szCircleTicket = ezxml_txt(ezxml_get(body, "CircleResult", 0, "CircleTicket", -1));
- ptrA szCircleTicketEnc(mir_base64_encode((PBYTE)szCircleTicket, (unsigned)strlen(szCircleTicket)));
+ ptrA szCircleTicketEnc(mir_base64_encode((PBYTE)szCircleTicket, (unsigned)mir_strlen(szCircleTicket)));
if (szCircleTicketEnc)
msnNsThread->sendPacket("USR", "SHA A %s", szCircleTicketEnc);
}
@@ -898,7 +898,7 @@ bool CMsnProto::MSN_ABRefreshClist(void) if (nlhrReply) {
hHttpsConnection = nlhrReply->nlc;
if (nlhrReply->resultCode == 200 && nlhrReply->pData) {
- ezxml_t xmlm = ezxml_parse_str(nlhrReply->pData, strlen(nlhrReply->pData));
+ ezxml_t xmlm = ezxml_parse_str(nlhrReply->pData, mir_strlen(nlhrReply->pData));
if (xmlm) {
bRet = true;
@@ -1021,7 +1021,7 @@ bool CMsnProto::MSN_ABAddDelContactGroup(const char* szCntId, const char* szGrpI if (tResult != NULL) {
UpdateABHost(szMethod, abUrl);
- ezxml_t xmlm = ezxml_parse_str(tResult, strlen(tResult));
+ ezxml_t xmlm = ezxml_parse_str(tResult, mir_strlen(tResult));
UpdateABCacheKey(xmlm, false);
if (status == 500) {
const char* szErr = ezxml_txt(getSoapFault(xmlm, true));
@@ -1082,7 +1082,7 @@ void CMsnProto::MSN_ABAddGroup(const char* szGrpName, bool allowRecurse) if (tResult != NULL) {
UpdateABHost("ABGroupAdd", abUrl);
- ezxml_t xmlm = ezxml_parse_str(tResult, strlen(tResult));
+ ezxml_t xmlm = ezxml_parse_str(tResult, mir_strlen(tResult));
UpdateABCacheKey(xmlm, false);
if (status == 200) {
ezxml_t body = getSoapResponse(xmlm, "ABGroupAdd");
@@ -1139,7 +1139,7 @@ void CMsnProto::MSN_ABRenameGroup(const char* szGrpName, const char* szGrpId, bo if (tResult != NULL) {
UpdateABHost("ABGroupUpdate", abUrl);
- ezxml_t xmlm = ezxml_parse_str(tResult, strlen(tResult));
+ ezxml_t xmlm = ezxml_parse_str(tResult, mir_strlen(tResult));
UpdateABCacheKey(xmlm, false);
if (status == 500) {
const char* szErr = ezxml_txt(getSoapFault(xmlm, true));
@@ -1224,7 +1224,7 @@ bool CMsnProto::MSN_ABAddRemoveContact(const char* szCntId, int netId, bool add, if (tResult != NULL) {
UpdateABHost("ABContactUpdate", abUrl);
- ezxml_t xmlm = ezxml_parse_str(tResult, strlen(tResult));
+ ezxml_t xmlm = ezxml_parse_str(tResult, mir_strlen(tResult));
UpdateABCacheKey(xmlm, false);
if (status == 500) {
const char* szErr = ezxml_txt(getSoapFault(xmlm, true));
@@ -1290,7 +1290,7 @@ bool CMsnProto::MSN_ABUpdateProperty(const char* szCntId, const char* propName, if (tResult != NULL) {
UpdateABHost("ABContactUpdate", abUrl);
- ezxml_t xmlm = ezxml_parse_str(tResult, strlen(tResult));
+ ezxml_t xmlm = ezxml_parse_str(tResult, mir_strlen(tResult));
UpdateABCacheKey(xmlm, false);
if (status == 500) {
const char* szErr = ezxml_txt(getSoapFault(xmlm, true));
@@ -1355,7 +1355,7 @@ void CMsnProto::MSN_ABUpdateAttr(const char* szCntId, const char* szAttr, const if (tResult != NULL) {
UpdateABHost("ABContactUpdate", abUrl);
- ezxml_t xmlm = ezxml_parse_str(tResult, strlen(tResult));
+ ezxml_t xmlm = ezxml_parse_str(tResult, mir_strlen(tResult));
UpdateABCacheKey(xmlm, false);
if (status == 500) {
const char* szErr = ezxml_txt(getSoapFault(xmlm, true));
@@ -1478,7 +1478,7 @@ unsigned CMsnProto::MSN_ABContactAdd(const char* szEmail, const char* szNick, in free(szData);
if (tResult != NULL) {
- ezxml_t xmlm = ezxml_parse_str(tResult, strlen(tResult));
+ ezxml_t xmlm = ezxml_parse_str(tResult, mir_strlen(tResult));
UpdateABCacheKey(xmlm, false);
if (status == 200) {
ezxml_t body = getSoapResponse(xmlm, "ABContactAdd");
@@ -1617,7 +1617,7 @@ void CMsnProto::MSN_ABUpdateDynamicItem(bool allowRecurse) if (tResult != NULL) {
UpdateABHost("UpdateDynamicItem", abUrl);
- ezxml_t xmlm = ezxml_parse_str(tResult, strlen(tResult));
+ ezxml_t xmlm = ezxml_parse_str(tResult, mir_strlen(tResult));
UpdateABCacheKey(xmlm, false);
if (status == 500) {
const char* szErr = ezxml_txt(getSoapFault(xmlm, true));
diff --git a/protocols/MSN/src/msn_soapstore.cpp b/protocols/MSN/src/msn_soapstore.cpp index 27393513a6..9bbe50fb89 100644 --- a/protocols/MSN/src/msn_soapstore.cpp +++ b/protocols/MSN/src/msn_soapstore.cpp @@ -60,7 +60,7 @@ ezxml_t CMsnProto::storeSoapHdr(const char* service, const char* scenario, ezxml tbdy = ezxml_add_child(bdy, service, 0);
ezxml_set_attr(tbdy, "xmlns", "http://www.msn.com/webservices/storage/2008");
- size_t hdrsz = strlen(service) + sizeof(storeReqHdr) + 20;
+ size_t hdrsz = mir_strlen(service) + sizeof(storeReqHdr) + 20;
httphdr = (char*)mir_alloc(hdrsz);
mir_snprintf(httphdr, hdrsz, storeReqHdr, service);
@@ -123,7 +123,7 @@ bool CMsnProto::MSN_StoreCreateProfile(bool allowRecurse) if (tResult != NULL) {
if (status == 200) {
- ezxml_t xmlm = ezxml_parse_str(tResult, strlen(tResult));
+ ezxml_t xmlm = ezxml_parse_str(tResult, mir_strlen(tResult));
UpdateStoreCacheKey(xmlm);
ezxml_t body = getSoapResponse(xmlm, "CreateProfile");
@@ -133,7 +133,7 @@ bool CMsnProto::MSN_StoreCreateProfile(bool allowRecurse) ezxml_free(xmlm);
}
else if (status == 500) {
- ezxml_t xmlm = ezxml_parse_str(tResult, strlen(tResult));
+ ezxml_t xmlm = ezxml_parse_str(tResult, mir_strlen(tResult));
const char* szErr = ezxml_txt(getSoapFault(xmlm, true));
if (strcmp(szErr, "PassportAuthFail") == 0 && allowRecurse) {
MSN_GetPassportAuth();
@@ -174,7 +174,7 @@ bool CMsnProto::MSN_StoreShareItem(const char* id, bool allowRecurse) free(szData);
if (tResult != NULL && status == 500) {
- ezxml_t xmlm = ezxml_parse_str(tResult, strlen(tResult));
+ ezxml_t xmlm = ezxml_parse_str(tResult, mir_strlen(tResult));
const char* szErr = ezxml_txt(getSoapFault(xmlm, true));
if (strcmp(szErr, "PassportAuthFail") == 0 && allowRecurse) {
MSN_GetPassportAuth();
@@ -252,7 +252,7 @@ bool CMsnProto::MSN_StoreGetProfile(bool allowRecurse) if (tResult != NULL) {
if (status == 200) {
- ezxml_t xmlm = ezxml_parse_str(tResult, strlen(tResult));
+ ezxml_t xmlm = ezxml_parse_str(tResult, mir_strlen(tResult));
ezxml_t body = getSoapResponse(xmlm, "GetProfile");
UpdateStoreHost("GetProfile", body ? storeUrl : NULL);
@@ -290,7 +290,7 @@ bool CMsnProto::MSN_StoreGetProfile(bool allowRecurse) ezxml_free(xmlm);
}
else if (status == 500 && allowRecurse) {
- ezxml_t xmlm = ezxml_parse_str(tResult, strlen(tResult));
+ ezxml_t xmlm = ezxml_parse_str(tResult, mir_strlen(tResult));
const char* szErr = ezxml_txt(getSoapFault(xmlm, true));
if (strcmp(szErr, "PassportAuthFail") == 0) {
MSN_GetPassportAuth();
@@ -361,7 +361,7 @@ bool CMsnProto::MSN_StoreUpdateProfile(const char* szNick, const char* szStatus, MSN_ABUpdateDynamicItem();
}
else if (status == 500 && allowRecurse) {
- ezxml_t xmlm = ezxml_parse_str(tResult, strlen(tResult));
+ ezxml_t xmlm = ezxml_parse_str(tResult, mir_strlen(tResult));
const char* szErr = ezxml_txt(getSoapFault(xmlm, true));
if (strcmp(szErr, "PassportAuthFail") == 0) {
MSN_GetPassportAuth();
@@ -419,7 +419,7 @@ bool CMsnProto::MSN_StoreCreateRelationships(bool allowRecurse) UpdateStoreHost("CreateRelationships", storeUrl);
if (status == 500) {
- ezxml_t xmlm = ezxml_parse_str(tResult, strlen(tResult));
+ ezxml_t xmlm = ezxml_parse_str(tResult, mir_strlen(tResult));
const char* szErr = ezxml_txt(getSoapFault(xmlm, true));
if (strcmp(szErr, "PassportAuthFail") == 0 && allowRecurse) {
MSN_GetPassportAuth();
@@ -486,7 +486,7 @@ bool CMsnProto::MSN_StoreDeleteRelationships(bool tile, bool allowRecurse) if (tResult != NULL) {
UpdateStoreHost("DeleteRelationships", storeUrl);
if (status == 500) {
- ezxml_t xmlm = ezxml_parse_str(tResult, strlen(tResult));
+ ezxml_t xmlm = ezxml_parse_str(tResult, mir_strlen(tResult));
const char* szErr = ezxml_txt(getSoapFault(xmlm, true));
if (strcmp(szErr, "PassportAuthFail") == 0 && allowRecurse) {
MSN_GetPassportAuth();
@@ -563,13 +563,13 @@ bool CMsnProto::MSN_StoreCreateDocument(const TCHAR *sztName, const char *szMime if (tResult != NULL) {
UpdateStoreHost("CreateDocument", storeUrl);
if (status == 200) {
- ezxml_t xmlm = ezxml_parse_str(tResult, strlen(tResult));
+ ezxml_t xmlm = ezxml_parse_str(tResult, mir_strlen(tResult));
ezxml_t bdy = getSoapResponse(xmlm, "CreateDocument");
strncpy_s(photoid, ezxml_txt(bdy), _TRUNCATE);
ezxml_free(xmlm);
}
else if (status == 500) {
- ezxml_t xmlm = ezxml_parse_str(tResult, strlen(tResult));
+ ezxml_t xmlm = ezxml_parse_str(tResult, mir_strlen(tResult));
const char* szErr = ezxml_txt(getSoapFault(xmlm, true));
if (strcmp(szErr, "PassportAuthFail") == 0 && allowRecurse) {
MSN_GetPassportAuth();
@@ -635,7 +635,7 @@ bool CMsnProto::MSN_StoreUpdateDocument(const TCHAR *sztName, const char *szMime if (tResult != NULL) {
UpdateStoreHost("UpdateDocument", storeUrl);
if (status == 500 && allowRecurse) {
- ezxml_t xmlm = ezxml_parse_str(tResult, strlen(tResult));
+ ezxml_t xmlm = ezxml_parse_str(tResult, mir_strlen(tResult));
const char* szErr = ezxml_txt(getSoapFault(xmlm, true));
if (strcmp(szErr, "PassportAuthFail") == 0) {
MSN_GetPassportAuth();
@@ -715,7 +715,7 @@ bool CMsnProto::MSN_StoreFindDocuments(bool allowRecurse) if (tResult != NULL) {
UpdateStoreHost("FindDocuments", storeUrl);
if (status == 500) {
- ezxml_t xmlm = ezxml_parse_str(tResult, strlen(tResult));
+ ezxml_t xmlm = ezxml_parse_str(tResult, mir_strlen(tResult));
const char* szErr = ezxml_txt(getSoapFault(xmlm, true));
if (strcmp(szErr, "PassportAuthFail") == 0 && allowRecurse) {
MSN_GetPassportAuth();
diff --git a/protocols/MSN/src/msn_ssl.cpp b/protocols/MSN/src/msn_ssl.cpp index b4f0402e4b..a2fdb581b3 100644 --- a/protocols/MSN/src/msn_ssl.cpp +++ b/protocols/MSN/src/msn_ssl.cpp @@ -35,7 +35,7 @@ char* CMsnProto::getSslResult(char** parUrl, const char* parAuthInfo, const char nlhr.requestType = REQUEST_POST;
nlhr.flags = NLHRF_HTTP11 | NLHRF_DUMPASTEXT | NLHRF_PERSISTENT | NLHRF_REDIRECT;
nlhr.szUrl = *parUrl;
- nlhr.dataLength = (int)strlen(parAuthInfo);
+ nlhr.dataLength = (int)mir_strlen(parAuthInfo);
nlhr.pData = (char*)parAuthInfo;
nlhr.nlc = hHttpsConnection;
diff --git a/protocols/Sametime/src/options.cpp b/protocols/Sametime/src/options.cpp index f86fdbdd96..cd44b6c915 100644 --- a/protocols/Sametime/src/options.cpp +++ b/protocols/Sametime/src/options.cpp @@ -411,7 +411,7 @@ void CSametimeProto::LoadOptions() if (options.err_method == ED_POP && !ServiceExists(MS_POPUP_SHOWMESSAGE)) options.err_method = ED_BAL;
if (options.err_method == ED_BAL && !ServiceExists(MS_CLIST_SYSTRAY_NOTIFY)) options.err_method = ED_MB;
- debugLog(_T("LoadOptions() loaded: ServerName:len=[%d], id:len=[%d], pword:len=[%d]"), options.server_name == NULL ? -1 : strlen(options.server_name), options.id == NULL ? -1 : strlen(options.id), options.pword == NULL ? -1 : strlen(options.pword));
+ debugLog(_T("LoadOptions() loaded: ServerName:len=[%d], id:len=[%d], pword:len=[%d]"), options.server_name == NULL ? -1 : mir_strlen(options.server_name), options.id == NULL ? -1 : mir_strlen(options.id), options.pword == NULL ? -1 : mir_strlen(options.pword));
debugLog(_T("LoadOptions() loaded: port=[%d], encrypt_session=[%d], ClientID=[%d], ClientVersionMajor=[%d], ClientVersionMinor=[%d]"), options.port, options.encrypt_session, options.client_id, options.client_versionMajor, options.client_versionMinor);
debugLog(_T("LoadOptions() loaded: get_server_contacts=[%d], add_contacts=[%d], idle_as_away=[%d], err_method=[%d]"), options.get_server_contacts, options.add_contacts, options.idle_as_away, options.err_method);
diff --git a/protocols/Sametime/src/sametime_session.cpp b/protocols/Sametime/src/sametime_session.cpp index 2e65171e51..871baf250b 100644 --- a/protocols/Sametime/src/sametime_session.cpp +++ b/protocols/Sametime/src/sametime_session.cpp @@ -275,7 +275,7 @@ int CSametimeProto::SetSessionStatus(int status) us.desc = AwayMessages.szOnline; us.status = mwStatus_ACTIVE; break;
}
- debugLog(_T("SetSessionStatus() mwSession_setUserStatus us.status=[%d], us.desc:len=[%d]"), us.status, us.desc == NULL ? -1 : strlen(us.desc));
+ debugLog(_T("SetSessionStatus() mwSession_setUserStatus us.status=[%d], us.desc:len=[%d]"), us.status, us.desc == NULL ? -1 : mir_strlen(us.desc));
mwSession_setUserStatus(session, &us);
return 0;
diff --git a/protocols/Sametime/src/userlist.cpp b/protocols/Sametime/src/userlist.cpp index 2523182785..223cecfdce 100644 --- a/protocols/Sametime/src/userlist.cpp +++ b/protocols/Sametime/src/userlist.cpp @@ -92,13 +92,13 @@ MCONTACT CSametimeProto::AddContact(mwSametimeUser* user, bool temporary) // add to miranda
if (new_contact) db_set_utf(hContact, m_szModuleName, "stid", id);
- if (name && strlen(name))
+ if (name && mir_strlen(name))
db_set_utf(hContact, m_szModuleName, "Name", name);
- if (nick && strlen(nick)) {
+ if (nick && mir_strlen(nick)) {
db_set_utf(hContact, m_szModuleName, "Nick", nick);
}
- else if (name && strlen(name)) {
+ else if (name && mir_strlen(name)) {
db_set_utf(hContact, m_szModuleName, "Nick", name);
}
else {
@@ -731,7 +731,7 @@ void mwResolve_handler_details_callback(mwServiceResolve* srvc, guint32 id, guin MCONTACT hContact = proto->FindContactByUserId(((mwResolveMatch*)mri->data)->id);
if (hContact) {
char* name = ((mwResolveMatch*)mri->data)->name;
- if (name && strlen(name)) {
+ if (name && mir_strlen(name)) {
db_set_utf(hContact, proto->m_szModuleName, "Name", name);
db_set_utf(hContact, proto->m_szModuleName, "Nick", name);
db_set_utf(hContact, "CList", "MyHandle", name);
diff --git a/protocols/SkypeClassic/src/debug.cpp b/protocols/SkypeClassic/src/debug.cpp index 4e7f7fd7b7..5b28e748de 100644 --- a/protocols/SkypeClassic/src/debug.cpp +++ b/protocols/SkypeClassic/src/debug.cpp @@ -51,7 +51,7 @@ void do_log(const char *pszFormat, ...) { EnterCriticalSection(&m_WriteFileMutex);
time(<);
ct=ctime(<);
- ct[strlen(ct)-1]=0;
+ ct[mir_strlen(ct)-1]=0;
do
{
va_start(ap, pszFormat);
@@ -61,7 +61,7 @@ void do_log(const char *pszFormat, ...) { {
if (!(pNewBuf = (char*)realloc (m_szLogBuf, m_iBufSize*2)))
{
- iLen = strlen (m_szLogBuf);
+ iLen = mir_strlen (m_szLogBuf);
break;
}
m_szLogBuf = pNewBuf;
diff --git a/protocols/SkypeClassic/src/filexfer.cpp b/protocols/SkypeClassic/src/filexfer.cpp index d0caedea03..af8af1c1cc 100644 --- a/protocols/SkypeClassic/src/filexfer.cpp +++ b/protocols/SkypeClassic/src/filexfer.cpp @@ -23,7 +23,7 @@ INT_PTR SkypeRecvFile(WPARAM, LPARAM lParam) if (pre->flags & PREF_CREATEREAD) dbei.flags |= DBEF_READ;
dbei.eventType = EVENTTYPE_FILE;
dbei.cbBlob = sizeof(DWORD);
- for (nFiles = 0; cbFilename = strlen(&pre->szMessage[dbei.cbBlob]); nFiles++)
+ for (nFiles = 0; cbFilename = mir_strlen(&pre->szMessage[dbei.cbBlob]); nFiles++)
dbei.cbBlob += DWORD(cbFilename) + 1;
dbei.cbBlob++;
dbei.pBlob = (PBYTE)pre->szMessage;
@@ -41,7 +41,7 @@ INT_PTR SkypeRecvFile(WPARAM, LPARAM lParam) pfts->totalFiles = nFiles;
if (pfts->pszFiles = (char**)calloc(nFiles + 1, sizeof(char*))) {
char *pFN;
- for (size_t i = 0; cbFilename = strlen(pFN = &pre->szMessage[iOffs]); i++) {
+ for (size_t i = 0; cbFilename = mir_strlen(pFN = &pre->szMessage[iOffs]); i++) {
pfts->pszFiles[i] = strdup(pFN);
iOffs += cbFilename + 1;
}
@@ -76,7 +76,7 @@ INT_PTR SkypeSendFile(WPARAM, LPARAM lParam) size_t iLen = 0;
for (nFiles = 0; files[nFiles]; nFiles++) {
utfmsg = (char*)make_utf8_string(files[nFiles]);
- iLen += strlen(utfmsg) + 3;
+ iLen += mir_strlen(utfmsg) + 3;
if (pszFile = pszFile ? (char*)realloc(pszFile, iLen) : (char*)calloc(1, iLen)) {
if (nFiles > 0) strcat(pszFile, ",");
strcat(pszFile, "\"");
@@ -221,7 +221,7 @@ BOOL FXHandleRecv(PROTORECVEVENT *pre, MCONTACT hContact) if (!strcmp(pszType, "INCOMING")) {
char *pszFN = SkypeGetErr("FILETRANSFER", pszMsgNum, "FILENAME");
if (pszFN) {
- cbNewSize = cbMsg + strlen(pszFN) + 2;
+ cbNewSize = cbMsg + mir_strlen(pszFN) + 2;
if ((pre->szMessage = (char*)realloc(pre->szMessage, cbNewSize))) {
memcpy(pre->szMessage + cbMsg, pszFN, cbNewSize - cbMsg - 1);
cbMsg = cbNewSize - 1;
diff --git a/protocols/SkypeClassic/src/skype.cpp b/protocols/SkypeClassic/src/skype.cpp index e152a1496e..7a28811213 100644 --- a/protocols/SkypeClassic/src/skype.cpp +++ b/protocols/SkypeClassic/src/skype.cpp @@ -222,7 +222,7 @@ int ShowMessage(int iconID, TCHAR *lpzText, int mustShow) { mir_tstrcpy(MessagePopup.lptzText, lpzText);
#ifdef _UNICODE
- mbstowcs(MessagePopup.lptzContactName, SKYPE_PROTONAME, strlen(SKYPE_PROTONAME) + 1);
+ mbstowcs(MessagePopup.lptzContactName, SKYPE_PROTONAME, mir_strlen(SKYPE_PROTONAME) + 1);
#else
mir_tstrcpy(MessagePopup.lptzContactName, SKYPE_PROTONAME);
#endif
@@ -242,9 +242,9 @@ int ShowMessage(int iconID, TCHAR *lpzText, int mustShow) { int ShowMessageA(int iconID, char *lpzText, int mustShow) {
WCHAR *lpwText;
int iRet;
- size_t len = mbstowcs(NULL, lpzText, strlen(lpzText));
+ size_t len = mbstowcs(NULL, lpzText, mir_strlen(lpzText));
if (len == -1 || !(lpwText = (WCHAR*)calloc(len + 1, sizeof(WCHAR)))) return -1;
- mbstowcs(lpwText, lpzText, strlen(lpzText));
+ mbstowcs(lpwText, lpzText, mir_strlen(lpzText));
iRet = ShowMessage(iconID, lpwText, mustShow);
free(lpwText);
return iRet;
@@ -503,12 +503,12 @@ static void QueryUserWaitingAuthorization(char *pszNick, char *pszAuthRq) }
}
- pre.lParam = sizeof(DWORD)+sizeof(HANDLE)+strlen(pszNick) + 5;
- if (firstname) pre.lParam += strlen(firstname);
- if (lastname) pre.lParam += strlen(lastname);
+ pre.lParam = sizeof(DWORD)+sizeof(HANDLE)+mir_strlen(pszNick) + 5;
+ if (firstname) pre.lParam += mir_strlen(firstname);
+ if (lastname) pre.lParam += mir_strlen(lastname);
if (pszAuthRq) authmsg = strdup(pszAuthRq);
if (authmsg || ((protocol >= 4 || bIsImoproxy) && (authmsg = SkypeGetID("USER", pszNick, "RECEIVEDAUTHREQUEST"))))
- pre.lParam += strlen(authmsg);
+ pre.lParam += mir_strlen(authmsg);
if (pre.szMessage = pCurBlob = (char *)calloc(1, pre.lParam)) {
pCurBlob += sizeof(DWORD); // Not used
memcpy(pCurBlob, &hContact, sizeof(HANDLE)); pCurBlob += sizeof(HANDLE);
@@ -644,7 +644,7 @@ void __cdecl SkypeSystemInit(char *dummy) { // against CURRENTUSERHANDLE
if (pszUser = SkypeRcv("CURRENTUSERHANDLE", INFINITE))
{
- memmove(pszUser, pszUser + 18, strlen(pszUser + 17));
+ memmove(pszUser, pszUser + 18, mir_strlen(pszUser + 17));
if (_stricmp(dbv.pszVal, pszUser))
{
// Doesn't match, maybe we have a second Skype instance we have to take
@@ -1133,7 +1133,7 @@ void FetchMessageThread(fetchmsg_arg *pargs) { __leave; // We failed
}
free(who);
- who = (char *)memmove(ptr, pTok, strlen(pTok) + 1);
+ who = (char *)memmove(ptr, pTok, mir_strlen(pTok) + 1);
direction = DBEF_SENT;
}
db_free(&dbv);
@@ -1167,7 +1167,7 @@ void FetchMessageThread(fetchmsg_arg *pargs) { __leave;
}
if (strncmp(ptr, "ERROR", 5)) {
- msgptr = ptr + strlen(szBuf + 4) + 1;
+ msgptr = ptr + mir_strlen(szBuf + 4) + 1;
bHasPartList = strncmp(msgptr, "<partlist ", 10) == 0;
if (args.pMsgEntry && args.pMsgEntry->tEdited) {
// Mark the message as edited
@@ -1202,7 +1202,7 @@ void FetchMessageThread(fetchmsg_arg *pargs) { mir_free(ci.pszVal);
}
}
- newlen = int(strlen(msgptr) + (pszUTFnick ? strlen(pszUTFnick) : 0) + 9);
+ newlen = int(mir_strlen(msgptr) + (pszUTFnick ? mir_strlen(pszUTFnick) : 0) + 9);
if (pMsg = (char *)malloc(newlen)) {
sprintf(pMsg, "** %s%s%s **", (pszUTFnick ? pszUTFnick : ""), (pszUTFnick ? " " : ""), (char*)msgptr);
free(ptr);
@@ -1225,7 +1225,7 @@ void FetchMessageThread(fetchmsg_arg *pargs) { msgptr = msg;
free(ptr);
}
- msglen = (int)strlen(msgptr) + 1;
+ msglen = (int)mir_strlen(msgptr) + 1;
}
else {
free(ptr);
@@ -1538,7 +1538,7 @@ void RingThread(char *szSkypeMsg) { dbei.szModule = SKYPE_PROTONAME;
dbei.timestamp = (DWORD)SkypeTime(NULL);
dbei.pBlob = (unsigned char*)Translate("Phone call");
- dbei.cbBlob = (int)strlen((const char*)dbei.pBlob) + 1;
+ dbei.cbBlob = (int)mir_strlen((const char*)dbei.pBlob) + 1;
if (!strncmp(ptr, "INCOMING", 8))
{
TCHAR *lpzContactName = (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR);
@@ -1990,7 +1990,7 @@ LRESULT APIENTRY WndProc(HWND hWndDlg, UINT message, UINT wParam, LONG lParam) // Other proerties that can be directly assigned to a DB-Value
for (int i = 0; i < sizeof(m_settings) / sizeof(m_settings[0]); i++) {
if (!strcmp(ptr, m_settings[i].SkypeSetting)) {
- char *pszProp = ptr + strlen(m_settings[i].SkypeSetting) + 1;
+ char *pszProp = ptr + mir_strlen(m_settings[i].SkypeSetting) + 1;
if (*pszProp)
db_set_utf(hContact, SKYPE_PROTONAME, m_settings[i].MirandaSetting, pszProp);
else
@@ -2070,7 +2070,7 @@ LRESULT APIENTRY WndProc(HWND hWndDlg, UINT message, UINT wParam, LONG lParam) *ptr = ' ';
}
else if (strncmp(ptr, " CHATMESSAGES ", 14) == 0) {
- int iLen=strlen(ptr+14)+1;
+ int iLen=mir_strlen(ptr+14)+1;
char *pParam=(char*)calloc(iLen+1, 1);
*pParam=TRUE;
memcpy(pParam+1, ptr+14, iLen);
@@ -2128,14 +2128,14 @@ LRESULT APIENTRY WndProc(HWND hWndDlg, UINT message, UINT wParam, LONG lParam) if (!strncmp(szSkypeMsg, "MESSAGES", 8) || !strncmp(szSkypeMsg, "CHATMESSAGES", 12)) {
char *pMsgs;
int iLen;
- if (strlen(szSkypeMsg) <= (UINT)((pMsgs=strchr(szSkypeMsg, ' ')) - szSkypeMsg + 1))
+ if (mir_strlen(szSkypeMsg) <= (UINT)((pMsgs=strchr(szSkypeMsg, ' ')) - szSkypeMsg + 1))
{
LOG(("%s %d %s %d", szSkypeMsg, (UINT)(strchr(szSkypeMsg, ' ') - szSkypeMsg + 1),
- strchr(szSkypeMsg, ' '), strlen(szSkypeMsg)));
+ strchr(szSkypeMsg, ' '), mir_strlen(szSkypeMsg)));
break;
}
LOG(("MessageListProcessingThread launched"));
- char *pParam=(char*)calloc((iLen=strlen(pMsgs)+1)+1, 1);
+ char *pParam=(char*)calloc((iLen=mir_strlen(pMsgs)+1)+1, 1);
memcpy(pParam+1, pMsgs, iLen);
pthread_create((pThreadFunc)MessageListProcessingThread, pParam);
break;
@@ -2754,7 +2754,7 @@ INT_PTR SkypeRecvMessage(WPARAM, LPARAM lParam) dbei.flags |= DBEF_READ;
dbei.flags |= DBEF_UTF;
dbei.eventType = EVENTTYPE_MESSAGE;
- dbei.cbBlob = (int)strlen(pre->szMessage) + 1;
+ dbei.cbBlob = (int)mir_strlen(pre->szMessage) + 1;
dbei.pBlob = (PBYTE)pre->szMessage;
MsgList_Add((DWORD)pre->lParam, db_event_add(ccs->hContact, &dbei));
return 0;
diff --git a/protocols/SkypeClassic/src/skypeapi.cpp b/protocols/SkypeClassic/src/skypeapi.cpp index bd8b8d6d11..35b4117560 100644 --- a/protocols/SkypeClassic/src/skypeapi.cpp +++ b/protocols/SkypeClassic/src/skypeapi.cpp @@ -195,7 +195,7 @@ void rcvThread(char *dummy) { COPYDATASTRUCT CopyData;
CopyData.dwData=0;
CopyData.lpData=buf;
- CopyData.cbData=(DWORD)strlen(buf)+1;
+ CopyData.cbData=(DWORD)mir_strlen(buf)+1;
if (!SendMessage(g_hWnd, WM_COPYDATALOCAL, (WPARAM)hSkypeWnd, (LPARAM)&CopyData))
{
LOG(("SendMessage failed: %08X", GetLastError()));
@@ -215,7 +215,7 @@ void sendThread(char *dummy) { while (SkypeMsgToSend) {
if (WaitForSingleObject(SkypeMsgToSend, INFINITE) != WAIT_OBJECT_0) return;
if (!(szMsg = MsgQ_Get(&SkypeSendQueue))) continue;
- length=(unsigned int)strlen(szMsg);
+ length=(unsigned int)mir_strlen(szMsg);
if (UseSockets) {
mir_cslock lck(SendMutex);
@@ -397,7 +397,7 @@ int SkypeSend(char *szFmt, ...) { {
if (!(pNewBuf = (char*)realloc (m_szSendBuf, m_iBufSize*2)))
{
- iLen = strlen (m_szSendBuf);
+ iLen = mir_strlen (m_szSendBuf);
break;
}
m_szSendBuf = pNewBuf;
@@ -450,23 +450,23 @@ char *SkypeRcvTime(char *what, time_t st, DWORD maxwait) { token=NULL;
break;
}
- token+=strlen(token)+1;
+ token+=mir_strlen(token)+1;
}
}
//if (j==1) {LOG(("SkypeRcv compare %s (%lu) -- %s (%lu)", ptr->message, ptr->tReceived, what, st));}
if ((st == 0 || ptr->tReceived >= st) &&
- (what==NULL || token || (what[0] && !strncmp(ptr->message, what, strlen(what))) ||
- (bIsChatMsg = (j==1 && bChatMsg && !strncmp(ptr->message, what+4, strlen(what+4)))) ||
+ (what==NULL || token || (what[0] && !strncmp(ptr->message, what, mir_strlen(what))) ||
+ (bIsChatMsg = (j==1 && bChatMsg && !strncmp(ptr->message, what+4, mir_strlen(what+4)))) ||
(j==1 && !strncmp(ptr->message, "ERROR", 5))))
{
msg=MsgQ_RemoveMsg(&SkypeMsgs, ptr);
LOG(("<SkypeRcv: %s", msg));
if (bIsChatMsg) {
- char *pmsg = (char*)realloc(msg, strlen(msg)+5);
+ char *pmsg = (char*)realloc(msg, mir_strlen(msg)+5);
if (pmsg) {
msg = pmsg;
- memmove (msg+4, msg, strlen(msg)+1);
+ memmove (msg+4, msg, mir_strlen(msg)+1);
memcpy (msg, "CHAT", 4);
}
@@ -500,7 +500,7 @@ char *SkypeRcvMsg(char *what, time_t st, MCONTACT hContact, DWORD maxwait) {
char *msg, msgid[32]={0}, *pMsg, *pCurMsg;
struct MsgQueue *ptr;
- int iLenWhat = (int)strlen(what);
+ int iLenWhat = (int)mir_strlen(what);
DWORD dwWaitStat;
BOOL bIsError, bProcess;
@@ -522,7 +522,7 @@ char *SkypeRcvMsg(char *what, time_t st, MCONTACT hContact, DWORD maxwait) else if (strncmp (pCurMsg, "ERROR", 5) == 0) bIsError = TRUE;
}
- if ((*msgid && strncmp (pCurMsg, msgid, strlen(msgid)) == 0) ||
+ if ((*msgid && strncmp (pCurMsg, msgid, mir_strlen(msgid)) == 0) ||
(!*what && ptr->tReceived >= st &&
(strncmp(pCurMsg, "MESSAGE", 7) == 0 || strncmp(pCurMsg, "CHATMESSAGE", 11) == 0 )
) || bIsError ||
@@ -586,7 +586,7 @@ static char *__SkypeGet(char *szID, char *szWhat, char *szWho, char *szProperty) time_t st = 0;
st = *szID?0:SkypeTime(NULL);
- str=(char *)_alloca((len=strlen(szWhat)+strlen(szWho)+strlen(szProperty)+(*szWho?2:1)+(len_id=strlen(szID)))+5);
+ str=(char *)_alloca((len=mir_strlen(szWhat)+mir_strlen(szWho)+mir_strlen(szProperty)+(*szWho?2:1)+(len_id=mir_strlen(szID)))+5);
sprintf(str, "%sGET %s%s%s %s", szID, szWhat, *szWho?" ":"", szWho, szProperty);
if (__sendMsg(str)) return NULL;
if (*szProperty) len++;
@@ -594,7 +594,7 @@ static char *__SkypeGet(char *szID, char *szWhat, char *szWho, char *szProperty) sprintf(str, "%s%s%s%s %s", szID, szWhat, *szWho?" ":"", szWho, szProperty);
ptr = SkypeRcvTime(str, st, INFINITE);
} else ptr = SkypeRcvTime(str+4, st, INFINITE);
- if (ptr && strncmp (ptr+len_id, "ERROR", 5)) memmove(ptr, ptr+len, strlen(ptr)-len+1);
+ if (ptr && strncmp (ptr+len_id, "ERROR", 5)) memmove(ptr, ptr+len, mir_strlen(ptr)-len+1);
LOG(("SkypeGet - Request %s -> Answer %s", str, ptr));
return ptr;
}
@@ -708,7 +708,7 @@ INT_PTR SkypeCall(WPARAM wParam, LPARAM lParam) { res = -1; // no direct return, because dbv needs to be freed
} else {
if (db_get_s(hContact, SKYPE_PROTONAME, SKYPE_NAME, &dbv)) return -1;
- msg=(char *)malloc(strlen(dbv.pszVal)+6);
+ msg=(char *)malloc(mir_strlen(dbv.pszVal)+6);
strcpy(msg, "CALL ");
strcat(msg, dbv.pszVal);
res=SkypeSend(msg);
@@ -737,7 +737,7 @@ INT_PTR SkypeCallHangup(WPARAM wParam, LPARAM lParam) char *msg=0;
if (!db_get_s(hContact, SKYPE_PROTONAME, "CallId", &dbv)) {
- msg=(char *)malloc(strlen(dbv.pszVal)+21);
+ msg=(char *)malloc(mir_strlen(dbv.pszVal)+21);
sprintf(msg, "SET %s STATUS FINISHED", dbv.pszVal);
//sprintf(msg, "ALTER CALL %s HANGUP", dbv.pszVal);
int res=SkypeSend(msg);
@@ -746,7 +746,7 @@ INT_PTR SkypeCallHangup(WPARAM wParam, LPARAM lParam) #endif
//} else {
// if (db_get(hContact, SKYPE_PROTONAME, SKYPE_NAME, &dbv)) return -1;
- // msg=(char *)malloc(strlen(dbv.pszVal)+6);
+ // msg=(char *)malloc(mir_strlen(dbv.pszVal)+6);
// strcpy(msg, "CALL ");
// strcat(msg, dbv.pszVal);
// res=SkypeSend(msg);
@@ -763,10 +763,10 @@ INT_PTR SkypeCallHangup(WPARAM wParam, LPARAM lParam) * Params : p - Pointer to the buffer with the number
*/
static void FixNumber(char *p) {
- for (unsigned int i=0;i<=strlen(p);i++)
+ for (unsigned int i=0;i<=mir_strlen(p);i++)
if ((p[i]<'0' || p[i]>'9'))
if (p[i]) {
- memmove(p+i, p+i+1, strlen(p+i));
+ memmove(p+i, p+i+1, mir_strlen(p+i));
i--;
} else break;
}
@@ -863,7 +863,7 @@ static INT_PTR CALLBACK DialDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR TempAdded=TRUE;
}
if (!db_set_s(hContact, SKYPE_PROTONAME, "SkypeOutNr", number)) {
- msg=(char *)malloc(strlen(number)+6);
+ msg=(char *)malloc(mir_strlen(number)+6);
strcpy(msg, "CALL ");
strcat(msg, number);
if (SkypeSend(msg) || (ptr=SkypeRcv("ERROR", 500))) {
@@ -1152,7 +1152,7 @@ INT_PTR SkypeSetAvatar(WPARAM wParam, LPARAM lParam) { if (filename == NULL)
return -1;
- len = strlen(filename);
+ len = mir_strlen(filename);
if (len < 4)
return -1;
@@ -1374,7 +1374,7 @@ char *GetSkypeErrorMsg(char *str) { case SENDER_NOT_AUTHORIZED: msg=Translate("Sending IM message to user, who has not authorized you and has chosen 'only people whom I have authorized can start IM'"); break;
default: msg=Translate("Unknown error");
}
- reason=(char *)malloc(strlen(pos)+strlen(msg)+3);
+ reason=(char *)malloc(mir_strlen(pos)+mir_strlen(msg)+3);
sprintf (reason, "%s: %s", pos, msg);
return reason;
}
@@ -1438,7 +1438,7 @@ void TranslateMirandaRelativePathToAbsolute(LPCSTR cszPath, LPSTR szAbsolutePath *szAbsolutePath = 0;
CallService (MS_UTILS_PATHTOABSOLUTE, (WPARAM)(*cszPath ? cszPath : ".\\"), (LPARAM)szAbsolutePath);
if(fQuoteSpaces && strchr((LPCSTR)szAbsolutePath, ' ')){
- memmove (szAbsolutePath+1, szAbsolutePath, strlen(szAbsolutePath)+1);
+ memmove (szAbsolutePath+1, szAbsolutePath, mir_strlen(szAbsolutePath)+1);
*szAbsolutePath='"';
strcat (szAbsolutePath, "\"");
}
@@ -1455,7 +1455,7 @@ static int my_spawnv(const char *cmdname, const char *const *argv, PROCESS_INFOR memset (pi, 0, sizeof(PROCESS_INFORMATION));
for (i=0; argv[i]; i++)
- iLen += (int)strlen(argv[i])+1;
+ iLen += (int)mir_strlen(argv[i])+1;
if (!(CommandLine = (char*)calloc(1, iLen))) return -1;
for (i=0; argv[i]; i++) {
if (i) strcat (CommandLine, " ");
@@ -1523,7 +1523,7 @@ static int _ConnectToSkypeAPI(char *path, int iStart) { OUTPUT(TranslateT("Authentication is not supported/needed for this Skype proxy server. It will be disabled."));
db_set_b(NULL, SKYPE_PROTONAME, "RequiresPassword", 0);
} else {
- unsigned int length=(unsigned int)strlen(dbv.pszVal);
+ unsigned int length=(unsigned int)mir_strlen(dbv.pszVal);
BOOL res = send(ClientSocket, (char *)&length, sizeof(length), 0)==SOCKET_ERROR
|| send(ClientSocket, dbv.pszVal, length, 0)==SOCKET_ERROR
|| recv(ClientSocket, (char *)&reply, sizeof(reply), 0)==SOCKET_ERROR;
@@ -1645,7 +1645,7 @@ static int _ConnectToSkypeAPI(char *path, int iStart) { {
int paramSize;
TranslateMirandaRelativePathToAbsolute(dbv.pszVal, szAbsolutePath, TRUE);
- paramSize = (int)strlen(SkypeOptions[i]) + (int)strlen(szAbsolutePath);
+ paramSize = (int)mir_strlen(SkypeOptions[i]) + (int)mir_strlen(szAbsolutePath);
pFree = args[j] = (char*)malloc(paramSize + 1);
sprintf(args[j],"%s%s",SkypeOptions[i],szAbsolutePath);
db_free(&dbv);
@@ -1692,7 +1692,7 @@ static int _ConnectToSkypeAPI(char *path, int iStart) { }*/
// if there is no skype installed and no custom command line, then exit .. else it crashes
- if (args[0] == NULL || strlen(args[0])==0)
+ if (args[0] == NULL || mir_strlen(args[0])==0)
{
return -1;
}
diff --git a/protocols/SkypeWeb/src/skype_db.cpp b/protocols/SkypeWeb/src/skype_db.cpp index 318c4b76ba..87a067b3f1 100644 --- a/protocols/SkypeWeb/src/skype_db.cpp +++ b/protocols/SkypeWeb/src/skype_db.cpp @@ -41,7 +41,7 @@ MEVENT CSkypeProto::GetMessageFromDb(MCONTACT hContact, const char *messageId, L if (dbei.eventType != EVENTTYPE_MESSAGE && dbei.eventType != SKYPE_DB_EVENT_TYPE_ACTION && dbei.eventType != SKYPE_DB_EVENT_TYPE_CALL_INFO)
continue;
- size_t cbLen = strlen((char*)dbei.pBlob);
+ size_t cbLen = mir_strlen((char*)dbei.pBlob);
if (memcmp(&dbei.pBlob[cbLen + 1], messageId, messageIdLength) == 0)
return hDbEvent;
diff --git a/protocols/SkypeWeb/src/skype_menus.cpp b/protocols/SkypeWeb/src/skype_menus.cpp index 00b2383e77..93c7add2a3 100644 --- a/protocols/SkypeWeb/src/skype_menus.cpp +++ b/protocols/SkypeWeb/src/skype_menus.cpp @@ -110,7 +110,7 @@ int CSkypeProto::OnInitStatusMenu() {
char text[MAX_PATH];
mir_strcpy(text, m_szModuleName);
- char *tDest = text + strlen(text);
+ char *tDest = text + mir_strlen(text);
CLISTMENUITEM mi = { sizeof(mi) };
mi.pszService = text;
diff --git a/protocols/SkypeWeb/src/skype_proto.cpp b/protocols/SkypeWeb/src/skype_proto.cpp index dc95b115ea..266e522395 100644 --- a/protocols/SkypeWeb/src/skype_proto.cpp +++ b/protocols/SkypeWeb/src/skype_proto.cpp @@ -122,9 +122,9 @@ MCONTACT CSkypeProto::AddToListByEvent(int, int, MEVENT hDbEvent) return NULL;
char *nick = (char*)(dbei.pBlob + sizeof(DWORD) * 2);
- char *firstName = nick + strlen(nick) + 1;
- char *lastName = firstName + strlen(firstName) + 1;
- char *skypename = lastName + strlen(lastName) + 1;
+ char *firstName = nick + mir_strlen(nick) + 1;
+ char *lastName = firstName + mir_strlen(firstName) + 1;
+ char *skypename = lastName + mir_strlen(lastName) + 1;
char *newSkypename = (dbei.flags & DBEF_UTF) ? mir_utf8decodeA(skypename) : skypename;
MCONTACT hContact = AddContact(newSkypename);
diff --git a/protocols/Steam/src/Steam/authorization.h b/protocols/Steam/src/Steam/authorization.h index 047b408b05..57401f91c5 100644 --- a/protocols/Steam/src/Steam/authorization.h +++ b/protocols/Steam/src/Steam/authorization.h @@ -18,7 +18,7 @@ namespace SteamWebApi ptrA(mir_urlEncode(password)),
timestamp);
- SetData(data, strlen(data));
+ SetData(data, mir_strlen(data));
}
AuthorizationRequest(const char *username, const char *password, const char *timestamp, const char *guardCode) :
@@ -34,7 +34,7 @@ namespace SteamWebApi guardCode,
timestamp);
- SetData(data, strlen(data));
+ SetData(data, mir_strlen(data));
}
AuthorizationRequest(const char *username, const char *password, const char *timestamp, const char *captchaId, const char *captchaText) :
@@ -51,7 +51,7 @@ namespace SteamWebApi ptrA(mir_urlEncode(captchaText)),
timestamp);
- SetData(data, strlen(data));
+ SetData(data, mir_strlen(data));
}
};
}
diff --git a/protocols/Steam/src/Steam/friend_list.h b/protocols/Steam/src/Steam/friend_list.h index eccc3d1224..cfa383c533 100644 --- a/protocols/Steam/src/Steam/friend_list.h +++ b/protocols/Steam/src/Steam/friend_list.h @@ -33,7 +33,7 @@ namespace SteamWebApi sessionId,
who);
- SetData(data, strlen(data));
+ SetData(data, mir_strlen(data));
AddHeader("Cookie", cookie);
}
};
@@ -56,7 +56,7 @@ namespace SteamWebApi sessionId,
who);
- SetData(data, strlen(data));
+ SetData(data, mir_strlen(data));
AddHeader("Cookie", cookie);
}
};
@@ -79,7 +79,7 @@ namespace SteamWebApi sessionId,
who);
- SetData(data, strlen(data));
+ SetData(data, mir_strlen(data));
AddHeader("Cookie", cookie);
}
};
diff --git a/protocols/Steam/src/Steam/login.h b/protocols/Steam/src/Steam/login.h index bf19c6f522..e2b9b41a81 100644 --- a/protocols/Steam/src/Steam/login.h +++ b/protocols/Steam/src/Steam/login.h @@ -12,7 +12,7 @@ namespace SteamWebApi char data[256];
mir_snprintf(data, SIZEOF(data), "access_token=%s&ui_mode=web", token);
- SetData(data, strlen(data));
+ SetData(data, mir_strlen(data));
}
};
@@ -25,7 +25,7 @@ namespace SteamWebApi char data[256];
mir_snprintf(data, SIZEOF(data), "access_token=%s&umqid=%s", token, umqId);
- SetData(data, strlen(data));
+ SetData(data, mir_strlen(data));
}
};
}
diff --git a/protocols/Steam/src/Steam/message.h b/protocols/Steam/src/Steam/message.h index ee5b5dcea7..bf0cb78b3d 100644 --- a/protocols/Steam/src/Steam/message.h +++ b/protocols/Steam/src/Steam/message.h @@ -31,7 +31,7 @@ namespace SteamWebApi // state);
// SecureHttpPostRequest request(hConnection, STEAM_API_URL "/ISteamWebUserPresenceOAuth/Message/v0001");
- // request.SetData(data, strlen(data));
+ // request.SetData(data, mir_strlen(data));
// mir_ptr<NETLIBHTTPREQUEST> response(request.Send());
// if (!response)
@@ -56,7 +56,7 @@ namespace SteamWebApi // ptrA(mir_urlEncode(text)));
// SecureHttpPostRequest request(hConnection, STEAM_API_URL "/ISteamWebUserPresenceOAuth/Message/v0001");
- // request.SetData(data, strlen(data));
+ // request.SetData(data, mir_strlen(data));
// mir_ptr<NETLIBHTTPREQUEST> response(request.Send());
// if (!response)
@@ -91,7 +91,7 @@ namespace SteamWebApi // steamId);
// SecureHttpPostRequest request(hConnection, STEAM_API_URL "/ISteamWebUserPresenceOAuth/Message/v0001");
- // request.SetData(data, strlen(data));
+ // request.SetData(data, mir_strlen(data));
// mir_ptr<NETLIBHTTPREQUEST> response(request.Send());
// if (!response)
diff --git a/protocols/Steam/src/Steam/pending.h b/protocols/Steam/src/Steam/pending.h index 68b86ad689..65a72d25d4 100644 --- a/protocols/Steam/src/Steam/pending.h +++ b/protocols/Steam/src/Steam/pending.h @@ -18,7 +18,7 @@ namespace SteamWebApi char data[MAX_PATH];
mir_snprintf(data, SIZEOF(data), "sessionID=%s&id=%s&perform=accept&action=approvePending&itype=friend&json=1&xml=0", sessionId, who);
- SetData(data, strlen(data));
+ SetData(data, mir_strlen(data));
AddHeader("Cookie", cookie);
}
};
@@ -38,7 +38,7 @@ namespace SteamWebApi char data[MAX_PATH];
mir_snprintf(data, SIZEOF(data), "sessionID=%s&id=%s&perform=ignore&action=approvePending&itype=friend&json=1&xml=0", sessionId, who);
- SetData(data, strlen(data));
+ SetData(data, mir_strlen(data));
AddHeader("Cookie", cookie);
}
};
@@ -58,7 +58,7 @@ namespace SteamWebApi char data[MAX_PATH];
mir_snprintf(data, SIZEOF(data), "sessionID=%s&id=%s&perform=block&action=approvePending&itype=friend&json=1&xml=0", sessionId, who);
- SetData(data, strlen(data));
+ SetData(data, mir_strlen(data));
AddHeader("Cookie", cookie);
}
};
diff --git a/protocols/Steam/src/Steam/session.h b/protocols/Steam/src/Steam/session.h index ea42cc77c4..20a5d7db53 100644 --- a/protocols/Steam/src/Steam/session.h +++ b/protocols/Steam/src/Steam/session.h @@ -18,7 +18,7 @@ namespace SteamWebApi steamId,
cookie);
- SetData(data, strlen(data));
+ SetData(data, mir_strlen(data));
}
};
}
diff --git a/protocols/Steam/src/steam_menus.cpp b/protocols/Steam/src/steam_menus.cpp index 8e2865bf22..a7b9626fc5 100644 --- a/protocols/Steam/src/steam_menus.cpp +++ b/protocols/Steam/src/steam_menus.cpp @@ -99,7 +99,7 @@ void CSteamProto::OnInitStatusMenu() {
char text[200];
mir_strncpy(text, m_szModuleName, 100);
- char* tDest = text + strlen(text);
+ char* tDest = text + mir_strlen(text);
CLISTMENUITEM mi = { sizeof(mi) };
mi.pszService = text;
diff --git a/protocols/Steam/src/steam_utils.cpp b/protocols/Steam/src/steam_utils.cpp index 46b7d8b6de..9484252d3a 100644 --- a/protocols/Steam/src/steam_utils.cpp +++ b/protocols/Steam/src/steam_utils.cpp @@ -50,7 +50,7 @@ int CSteamProto::MirandaToSteamState(int status) int CSteamProto::RsaEncrypt(const char *pszModulus, const char *data, BYTE *encryptedData, DWORD &encryptedSize)
{
- DWORD cchModulus = (DWORD)strlen(pszModulus);
+ DWORD cchModulus = (DWORD)mir_strlen(pszModulus);
int result = 0;
BYTE *pbBuffer = 0;
BYTE *pKeyBlob = 0;
@@ -118,7 +118,7 @@ int CSteamProto::RsaEncrypt(const char *pszModulus, const char *data, BYTE *encr goto exit;
}
- DWORD dataSize = (DWORD)strlen(data);
+ DWORD dataSize = (DWORD)mir_strlen(data);
// if data is not allocated just renurn size
if (encryptedData == NULL)
diff --git a/protocols/Tlen/src/tlen.cpp b/protocols/Tlen/src/tlen.cpp index 32dbe61ffa..f824620131 100644 --- a/protocols/Tlen/src/tlen.cpp +++ b/protocols/Tlen/src/tlen.cpp @@ -184,7 +184,7 @@ INT_PTR TlenProtocol::MenuHandleInbox(WPARAM wParam, LPARAM lParam) if (db_get_b(NULL, m_szModuleName, "SavePassword", TRUE) == TRUE)
password = db_get_sa(NULL, m_szModuleName, "Password");
- else if (threadData != NULL && strlen(threadData->password) > 0)
+ else if (threadData != NULL && mir_strlen(threadData->password) > 0)
password = mir_strdup(threadData->password);
memset(&cookie, 0, sizeof(cookie));
@@ -199,7 +199,7 @@ INT_PTR TlenProtocol::MenuHandleInbox(WPARAM wParam, LPARAM lParam) req.headersCount = 1;
req.headers = headers;
req.pData = form;
- req.dataLength = (int)strlen(form);
+ req.dataLength = (int)mir_strlen(form);
req.szUrl = "http://poczta.o2.pl/login.html";
resp = (NETLIBHTTPREQUEST *)CallService(MS_NETLIB_HTTPTRANSACTION, (WPARAM)m_hNetlibUser, (LPARAM)&req);
if (resp != NULL) {
@@ -212,7 +212,7 @@ INT_PTR TlenProtocol::MenuHandleInbox(WPARAM wParam, LPARAM lParam) char *end = strstr(resp->headers[i].szValue, ";");
start = start + 5;
if (end == NULL) {
- end = resp->headers[i].szValue + strlen(resp->headers[i].szValue);
+ end = resp->headers[i].szValue + mir_strlen(resp->headers[i].szValue);
}
strncpy(cookie, start, (end - start));
break;
@@ -261,7 +261,7 @@ void TlenProtocol::initMenuItems() {
char text[_MAX_PATH];
strncpy_s(text, sizeof(text), m_szModuleName, _TRUNCATE);
- char *pSvcName = text + strlen(text);
+ char *pSvcName = text + mir_strlen(text);
CLISTMENUITEM mi = { sizeof(mi) }, clmi = { sizeof(clmi) };
clmi.flags = CMIM_FLAGS | CMIF_GRAYED;
diff --git a/protocols/Tlen/src/tlen_avatar.cpp b/protocols/Tlen/src/tlen_avatar.cpp index ba336d2660..bfa27646e0 100644 --- a/protocols/Tlen/src/tlen_avatar.cpp +++ b/protocols/Tlen/src/tlen_avatar.cpp @@ -173,17 +173,17 @@ void TlenProcessPresenceAvatar(TlenProtocol *proto, XmlNode *node, TLEN_LIST_ITE static char *replaceTokens(const char *base, const char *uri, const char *login, const char* token, int type, int access) { char *result; int i, l, size; - l = (int)strlen(uri); - size = (int)strlen(base); + l = (int)mir_strlen(uri); + size = (int)mir_strlen(base); for (i = 0; i < l; ) { if (!strncmp(uri + i, "^login^", 7)) { - size += (int)strlen(login); + size += (int)mir_strlen(login); i += 7; } else if (!strncmp(uri + i, "^type^", 6)) { size++; i += 6; } else if (!strncmp(uri + i, "^token^", 7)) { - size += (int)strlen(token); + size += (int)mir_strlen(token); i += 7; } else if (!strncmp(uri + i, "^access^", 8)) { size++; @@ -195,18 +195,18 @@ static char *replaceTokens(const char *base, const char *uri, const char *login, } result = (char *)mir_alloc(size +1); strcpy(result, base); - size = (int)strlen(base); + size = (int)mir_strlen(base); for (i = 0; i < l; ) { if (!strncmp(uri + i, "^login^", 7)) { strcpy(result + size, login); - size += (int)strlen(login); + size += (int)mir_strlen(login); i += 7; } else if (!strncmp(uri + i, "^type^", 6)) { result[size++] = '0' + type; i += 6; } else if (!strncmp(uri + i, "^token^", 7)) { strcpy(result + size, token); - size += (int)strlen(token); + size += (int)mir_strlen(token); i += 7; } else if (!strncmp(uri + i, "^access^", 8)) { result[size++] = '0' + access; @@ -400,7 +400,7 @@ void TlenUploadAvatar(TlenProtocol *proto, unsigned char *data, int dataLen, int if (proto->threadData != NULL && dataLen > 0 && data != NULL) { char *mpartHead = "--AaB03x\r\nContent-Disposition: form-data; name=\"filename\"; filename=\"plik.png\"\r\nContent-Type: image/png\r\n\r\n"; char *mpartTail = "\r\n--AaB03x--\r\n"; - int size, sizeHead = (int)strlen(mpartHead), sizeTail = (int)strlen(mpartTail); + int size, sizeHead = (int)mir_strlen(mpartHead), sizeTail = (int)mir_strlen(mpartTail); char *request = replaceTokens(proto->threadData->tlenConfig.mailBase, proto->threadData->tlenConfig.avatarUpload, "", proto->threadData->avatarToken, 0, access); TLENUPLOADAVATARTHREADDATA *threadData = (TLENUPLOADAVATARTHREADDATA *)mir_alloc(sizeof(TLENUPLOADAVATARTHREADDATA)); threadData->proto = proto; diff --git a/protocols/Tlen/src/tlen_file.cpp b/protocols/Tlen/src/tlen_file.cpp index 830c828cf4..9d05fef08f 100644 --- a/protocols/Tlen/src/tlen_file.cpp +++ b/protocols/Tlen/src/tlen_file.cpp @@ -79,9 +79,9 @@ static void TlenFileReceiveParse(TLEN_FILE_TRANSFER *ft) TlenP2PPacketSend(ft->s, packet);
TlenP2PPacketFree(packet);
- fullFileName = (char *) mir_alloc(strlen(ft->szSavePath) + strlen(ft->files[ft->currentFile]) + 2);
+ fullFileName = (char *) mir_alloc(mir_strlen(ft->szSavePath) + mir_strlen(ft->files[ft->currentFile]) + 2);
strcpy(fullFileName, ft->szSavePath);
- if (fullFileName[strlen(fullFileName)-1] != '\\')
+ if (fullFileName[mir_strlen(fullFileName)-1] != '\\')
strcat(fullFileName, "\\");
strcat(fullFileName, ft->files[ft->currentFile]);
ft->fileId = _open(fullFileName, _O_BINARY|_O_WRONLY|_O_CREAT|_O_TRUNC, _S_IREAD|_S_IWRITE);
diff --git a/protocols/Tlen/src/tlen_iqid.cpp b/protocols/Tlen/src/tlen_iqid.cpp index 7c5368822f..837a24d81b 100644 --- a/protocols/Tlen/src/tlen_iqid.cpp +++ b/protocols/Tlen/src/tlen_iqid.cpp @@ -407,7 +407,7 @@ void TlenIqResultSearch(TlenProtocol *proto, XmlNode *iqNode) char *str = TlenXmlGetAttrValue(iqNode, "id");
if (str == NULL)
return;
- int id = atoi(str+strlen(TLEN_IQID));
+ int id = atoi(str+mir_strlen(TLEN_IQID));
if (!strcmp(type, "result")) {
if ((queryNode=TlenXmlGetChild(iqNode, "query")) == NULL) return;
diff --git a/protocols/Tlen/src/tlen_list.cpp b/protocols/Tlen/src/tlen_list.cpp index ddd31b3340..5827fad64f 100644 --- a/protocols/Tlen/src/tlen_list.cpp +++ b/protocols/Tlen/src/tlen_list.cpp @@ -111,13 +111,13 @@ int TlenListExist(TlenProtocol *proto, TLEN_LIST list, const char *jid) size_t len;
char *s, *p;
s = GetItemId(list, jid);
- len = strlen(s);
+ len = mir_strlen(s);
mir_cslock lck(proto->csLists);
for (i=0; i<proto->listsCount; i++)
if (proto->lists[i].list == list) {
p = proto->lists[i].jid;
- if (p && strlen(p) >= len && (p[(int)len] == '\0' || p[(int)len] == '/') && !strncmp(p, s, len)) {
+ if (p && mir_strlen(p) >= len && (p[(int)len] == '\0' || p[(int)len] == '/') && !strncmp(p, s, len)) {
mir_free(s);
return i+1;
}
@@ -265,7 +265,7 @@ TLEN_LIST_ITEM *TlenListFindItemPtrById2(TlenProtocol *proto, TLEN_LIST list, co size_t len;
char *p;
- len = strlen(id);
+ len = mir_strlen(id);
mir_cslock lck(proto->csLists);
for (i=0; i<proto->listsCount; i++) {
diff --git a/protocols/Tlen/src/tlen_misc.cpp b/protocols/Tlen/src/tlen_misc.cpp index c7205a31cd..e3b4fe6c1e 100644 --- a/protocols/Tlen/src/tlen_misc.cpp +++ b/protocols/Tlen/src/tlen_misc.cpp @@ -60,14 +60,14 @@ void TlenDBAddAuthRequest(TlenProtocol *proto, char *jid, char *nick) proto->debugLogA("auth request: %s, %s", jid, nick);
//blob is: uin(DWORD), hContact(HANDLE), nick(ASCIIZ), first(ASCIIZ), last(ASCIIZ), email(ASCIIZ), reason(ASCIIZ)
//blob is: 0(DWORD), hContact(HANDLE), nick(ASCIIZ), ""(ASCIIZ), ""(ASCIIZ), email(ASCIIZ), ""(ASCIIZ)
- cbBlob = sizeof(DWORD) + sizeof(HANDLE) + (int)strlen(nick) + (int)strlen(jid) + 5;
+ cbBlob = sizeof(DWORD) + sizeof(HANDLE) + (int)mir_strlen(nick) + (int)mir_strlen(jid) + 5;
pBlob = pCurBlob = (PBYTE) mir_alloc(cbBlob);
*((PDWORD)pCurBlob) = 0; pCurBlob += sizeof(DWORD);
*((PDWORD)pCurBlob) = (DWORD)hContact; pCurBlob += sizeof(DWORD);
- strcpy((char *) pCurBlob, nick); pCurBlob += strlen(nick)+1;
+ strcpy((char *) pCurBlob, nick); pCurBlob += mir_strlen(nick)+1;
*pCurBlob = '\0'; pCurBlob++; //firstName
*pCurBlob = '\0'; pCurBlob++; //lastName
- strcpy((char *) pCurBlob, jid); pCurBlob += strlen(jid)+1;
+ strcpy((char *) pCurBlob, jid); pCurBlob += mir_strlen(jid)+1;
*pCurBlob = '\0'; //reason
TlenDBAddEvent(proto, NULL, EVENTTYPE_AUTHREQUEST, 0, pBlob, cbBlob);
}
diff --git a/protocols/Tlen/src/tlen_p2p_old.cpp b/protocols/Tlen/src/tlen_p2p_old.cpp index 3d3668b42d..dee4b8831a 100644 --- a/protocols/Tlen/src/tlen_p2p_old.cpp +++ b/protocols/Tlen/src/tlen_p2p_old.cpp @@ -309,7 +309,7 @@ static HANDLE TlenP2PBindSocks4(SOCKSBIND * sb, TLEN_FILE_TRANSFER *ft) *(PDWORD)(buf+4) = INADDR_ANY;
if (sb->useAuth) {
strcpy((char*)buf+8, sb->szUser);
- len = (int)strlen(sb->szUser);
+ len = (int)mir_strlen(sb->szUser);
} else {
buf[8] = 0;
len = 0;
@@ -374,8 +374,8 @@ static HANDLE TlenP2PBindSocks5(SOCKSBIND * sb, TLEN_FILE_TRANSFER *ft) int nUserLen, nPassLen;
PBYTE pAuthBuf;
- nUserLen = (int)strlen(sb->szUser);
- nPassLen = (int)strlen(sb->szPassword);
+ nUserLen = (int)mir_strlen(sb->szUser);
+ nPassLen = (int)mir_strlen(sb->szPassword);
pAuthBuf = (PBYTE)mir_alloc(3+nUserLen+nPassLen);
pAuthBuf[0] = 1; //auth version
pAuthBuf[1] = nUserLen;
diff --git a/protocols/Tlen/src/tlen_presence.cpp b/protocols/Tlen/src/tlen_presence.cpp index e9e4b11fe7..a3920281b7 100644 --- a/protocols/Tlen/src/tlen_presence.cpp +++ b/protocols/Tlen/src/tlen_presence.cpp @@ -281,9 +281,9 @@ static void TlenSendPresenceTo(TlenProtocol *proto, int status, char *to) else if (!_strnicmp(ptr+i,"%date%",6)) GetDateFormatA(LOCALE_USER_DEFAULT,DATE_SHORTDATE,NULL,NULL,substituteStr,sizeof(substituteStr)); else continue; - if (strlen(substituteStr)>6) ptr=(char*)mir_realloc(ptr,strlen(ptr)+1+strlen(substituteStr)-6); - memmove(ptr+i+strlen(substituteStr),ptr+i+6,strlen(ptr)-i-5); - memcpy(ptr+i,substituteStr,strlen(substituteStr)); + if (mir_strlen(substituteStr)>6) ptr=(char*)mir_realloc(ptr,mir_strlen(ptr)+1+mir_strlen(substituteStr)-6); + memmove(ptr+i+mir_strlen(substituteStr),ptr+i+6,mir_strlen(ptr)-i-5); + memcpy(ptr+i,substituteStr,mir_strlen(substituteStr)); } } } diff --git a/protocols/Tlen/src/tlen_svc.cpp b/protocols/Tlen/src/tlen_svc.cpp index 9481729dd8..b578bf6e6b 100644 --- a/protocols/Tlen/src/tlen_svc.cpp +++ b/protocols/Tlen/src/tlen_svc.cpp @@ -251,9 +251,9 @@ MCONTACT TlenProtocol::AddToListByEvent(int flags, int iContact, MEVENT hDbEvent }
char *nick = (char *)dbei.pBlob + sizeof(DWORD)*2;
- char *firstName = nick + strlen(nick) + 1;
- char *lastName = firstName + strlen(firstName) + 1;
- char *jid = lastName + strlen(lastName) + 1;
+ char *firstName = nick + mir_strlen(nick) + 1;
+ char *lastName = firstName + mir_strlen(firstName) + 1;
+ char *jid = lastName + mir_strlen(lastName) + 1;
MCONTACT hContact = (MCONTACT) AddToListByJID(this, jid, flags);
mir_free(dbei.pBlob);
@@ -284,9 +284,9 @@ int TlenProtocol::Authorize(MEVENT hDbEvent) }
char *nick = (char *)dbei.pBlob + sizeof(DWORD)*2;
- char *firstName = nick + strlen(nick) + 1;
- char *lastName = firstName + strlen(firstName) + 1;
- char *jid = lastName + strlen(lastName) + 1;
+ char *firstName = nick + mir_strlen(nick) + 1;
+ char *lastName = firstName + mir_strlen(firstName) + 1;
+ char *jid = lastName + mir_strlen(lastName) + 1;
TlenSend(this, "<presence to='%s' type='subscribed'/>", jid);
@@ -333,9 +333,9 @@ int TlenProtocol::AuthDeny(MEVENT hDbEvent, const PROTOCHAR* szReason) }
char *nick = (char *)dbei.pBlob + sizeof(DWORD)*2;
- char *firstName = nick + strlen(nick) + 1;
- char *lastName = firstName + strlen(firstName) + 1;
- char *jid = lastName + strlen(lastName) + 1;
+ char *firstName = nick + mir_strlen(nick) + 1;
+ char *lastName = firstName + mir_strlen(firstName) + 1;
+ char *jid = lastName + mir_strlen(lastName) + 1;
TlenSend(this, "<presence to='%s' type='unsubscribed'/>", jid);
TlenSend(this, "<iq type='set'><query xmlns='jabber:iq:roster'><item jid='%s' subscription='remove'/></query></iq>", jid);
diff --git a/protocols/Tlen/src/tlen_thread.cpp b/protocols/Tlen/src/tlen_thread.cpp index 6d93071a28..2b6af296c1 100644 --- a/protocols/Tlen/src/tlen_thread.cpp +++ b/protocols/Tlen/src/tlen_thread.cpp @@ -635,7 +635,7 @@ static void TlenProcessMessage(XmlNode *node, ThreadData *info) if ((bodyNode=TlenXmlGetChild(node, "body")) != NULL) {
if (bodyNode->text != NULL) {
if ((subjectNode=TlenXmlGetChild(node, "subject")) != NULL && subjectNode->text != NULL && subjectNode->text[0] != '\0') {
- size_t size = strlen(subjectNode->text)+strlen(bodyNode->text)+5;
+ size_t size = mir_strlen(subjectNode->text)+mir_strlen(bodyNode->text)+5;
p = (char *)mir_alloc(size);
mir_snprintf(p, size, "%s\r\n%s", subjectNode->text, bodyNode->text);
localMessage = TlenTextDecode(p);
@@ -744,8 +744,8 @@ static void TlenProcessIq(XmlNode *node, ThreadData *info) id = -1;
if ((idStr=TlenXmlGetAttrValue(node, "id")) != NULL) {
- if (!strncmp(idStr, TLEN_IQID, strlen(TLEN_IQID)))
- id = atoi(idStr+strlen(TLEN_IQID));
+ if (!strncmp(idStr, TLEN_IQID, mir_strlen(TLEN_IQID)))
+ id = atoi(idStr+mir_strlen(TLEN_IQID));
}
queryNode = TlenXmlGetChild(node, "query");
@@ -1130,7 +1130,7 @@ static void TlenProcessP(XmlNode *node, ThreadData *info) iNode = TlenXmlGetChild(xNode, "i");
if (iNode != NULL) {
iStr = TlenXmlGetAttrValue(iNode, "i");
- temp = (char*)mir_alloc(strlen(f)+strlen(iStr)+2);
+ temp = (char*)mir_alloc(mir_strlen(f)+mir_strlen(iStr)+2);
strcpy(temp, f);
strcat(temp, "/");
strcat(temp, iStr);
diff --git a/protocols/Tlen/src/tlen_util.cpp b/protocols/Tlen/src/tlen_util.cpp index 228f8dae8e..55420658cd 100644 --- a/protocols/Tlen/src/tlen_util.cpp +++ b/protocols/Tlen/src/tlen_util.cpp @@ -62,7 +62,7 @@ int TlenSend(TlenProtocol *proto, const char *fmt, ...) va_end(vararg);
proto->debugLogA("SEND:%s", str);
- size = (int)strlen(str);
+ size = (int)mir_strlen(str);
if (proto->threadData != NULL) {
if (proto->threadData->useAES) {
result = TlenWsSendAES(proto, str, size, &proto->threadData->aes_out_context, proto->threadData->aes_out_iv);
@@ -84,9 +84,9 @@ char *TlenResourceFromJID(const char *jid2) p=strchr(jid, '/');
if (p != NULL && p[1] != '\0') {
p++;
- if ((nick=(char *) mir_alloc(1+strlen(jid)-(p-jid))) != NULL) {
- strncpy(nick, p, strlen(jid)-(p-jid));
- nick[strlen(jid)-(p-jid)] = '\0';
+ if ((nick=(char *) mir_alloc(1+mir_strlen(jid)-(p-jid))) != NULL) {
+ strncpy(nick, p, mir_strlen(jid)-(p-jid));
+ nick[mir_strlen(jid)-(p-jid)] = '\0';
}
}
else {
@@ -161,7 +161,7 @@ char *TlenSha1(char *str) return NULL;
mir_sha1_init( &sha );
- mir_sha1_append( &sha, (BYTE* )str, (int)strlen( str ));
+ mir_sha1_append( &sha, (BYTE* )str, (int)mir_strlen( str ));
mir_sha1_finish( &sha, (BYTE* )digest );
if ((result=(char *)mir_alloc(41)) == NULL)
return NULL;
@@ -215,7 +215,7 @@ char *TlenUrlEncode(const char *str) unsigned char c;
if (str == NULL) return NULL;
- res = (char *) mir_alloc(3*strlen(str) + 1);
+ res = (char *) mir_alloc(3*mir_strlen(str) + 1);
for (p=(char *)str,q=res; *p != '\0'; p++,q++) {
if (*p == ' ') {
*q = '+';
@@ -406,8 +406,8 @@ void TlenStringAppend(char **str, int *sizeAlloced, const char *fmt, ...) len = 0;
}
else {
- len = (int)strlen(*str);
- size = *sizeAlloced - (int)strlen(*str);
+ len = (int)mir_strlen(*str);
+ size = *sizeAlloced - (int)mir_strlen(*str);
}
p = *str + len;
@@ -433,7 +433,7 @@ BOOL IsAuthorized(TlenProtocol *proto, const char *jid) void TlenLogMessage(TlenProtocol *proto, MCONTACT hContact, DWORD flags, const char *message)
{
- int size = (int)strlen(message) + 2;
+ int size = (int)mir_strlen(message) + 2;
char *localMessage = (char *)mir_alloc(size);
strcpy(localMessage, message);
localMessage[size - 1] = '\0';
diff --git a/protocols/Tlen/src/tlen_xml.cpp b/protocols/Tlen/src/tlen_xml.cpp index 87fdd52211..04e6aa79a3 100644 --- a/protocols/Tlen/src/tlen_xml.cpp +++ b/protocols/Tlen/src/tlen_xml.cpp @@ -193,7 +193,7 @@ static void TlenXmlParseAttr(XmlNode *node, char *text) char *p; XmlAttr *a; - if (node == NULL || text == NULL || strlen(text) <= 0) + if (node == NULL || text == NULL || mir_strlen(text) <= 0) return; for (p=text;;) { @@ -387,7 +387,7 @@ char *TlenXmlGetAttrValue(XmlNode *node, char *key) { int i; - if (node == NULL || node->numAttr <= 0 || key == NULL || strlen(key) <= 0) + if (node == NULL || node->numAttr <= 0 || key == NULL || mir_strlen(key) <= 0) return NULL; for (i=0; i<node->numAttr; i++) { if (node->attr[i]->name && !strcmp(key, node->attr[i]->name)) @@ -405,7 +405,7 @@ XmlNode *TlenXmlGetNthChild(XmlNode *node, char *tag, int nth) { int i, num; - if (node == NULL || node->numChild <= 0 || tag == NULL || strlen(tag) <= 0 || nth < 1) + if (node == NULL || node->numChild <= 0 || tag == NULL || mir_strlen(tag) <= 0 || nth < 1) return NULL; num = 1; for (i=0; i<node->numChild; i++) { @@ -424,7 +424,7 @@ XmlNode *TlenXmlGetChildWithGivenAttrValue(XmlNode *node, char *tag, char *attrK int i; char *str; - if (node == NULL || node->numChild <= 0 || tag == NULL || strlen(tag) <= 0 || attrKey == NULL || strlen(attrKey) <= 0 || attrValue == NULL || strlen(attrValue) <= 0) + if (node == NULL || node->numChild <= 0 || tag == NULL || mir_strlen(tag) <= 0 || attrKey == NULL || mir_strlen(attrKey) <= 0 || attrValue == NULL || mir_strlen(attrValue) <= 0) return NULL; for (i=0; i<node->numChild; i++) { if (node->child[i]->name && !strcmp(tag, node->child[i]->name)) { diff --git a/protocols/Tox/src/tox_menus.cpp b/protocols/Tox/src/tox_menus.cpp index 6338b74767..95b37d9dcb 100644 --- a/protocols/Tox/src/tox_menus.cpp +++ b/protocols/Tox/src/tox_menus.cpp @@ -78,7 +78,7 @@ int CToxProto::OnInitStatusMenu() {
char text[MAX_PATH];
mir_strcpy(text, m_szModuleName);
- char *tDest = text + strlen(text);
+ char *tDest = text + mir_strlen(text);
CLISTMENUITEM mi = { sizeof(mi) };
mi.pszService = text;
diff --git a/protocols/Tox/src/tox_network.cpp b/protocols/Tox/src/tox_network.cpp index d97496b856..1191568773 100644 --- a/protocols/Tox/src/tox_network.cpp +++ b/protocols/Tox/src/tox_network.cpp @@ -68,7 +68,7 @@ void CToxProto::BootstrapNodesFromIni(bool isIPv6) BootstrapNode(address, port, pubKey);
}
}
- section += strlen(section) + 1;
+ section += mir_strlen(section) + 1;
}
}
}
diff --git a/protocols/Tox/src/tox_options.cpp b/protocols/Tox/src/tox_options.cpp index 131abcb858..40cfa41e49 100644 --- a/protocols/Tox/src/tox_options.cpp +++ b/protocols/Tox/src/tox_options.cpp @@ -429,7 +429,7 @@ void CToxOptionsNodeList::OnInitDialog() GetPrivateProfileStringA(section, "PubKey", NULL, value, SIZEOF(value), fileName);
m_nodes.SetItem(iItem, 3, mir_a2t(value));
}
- section += strlen(section) + 1;
+ section += mir_strlen(section) + 1;
}
}
diff --git a/protocols/Tox/src/tox_search.cpp b/protocols/Tox/src/tox_search.cpp index 0c66c33fea..0eb8eca77e 100644 --- a/protocols/Tox/src/tox_search.cpp +++ b/protocols/Tox/src/tox_search.cpp @@ -108,7 +108,7 @@ void CToxProto::SearchByNameAsync(void *arg) tox_dns3_kill(dns);
}
}
- section += strlen(section) + 1;
+ section += mir_strlen(section) + 1;
}
}
diff --git a/protocols/Twitter/src/proto.cpp b/protocols/Twitter/src/proto.cpp index dd28a80e25..d2391def89 100644 --- a/protocols/Twitter/src/proto.cpp +++ b/protocols/Twitter/src/proto.cpp @@ -258,7 +258,7 @@ int TwitterProto::OnBuildStatusMenu(WPARAM, LPARAM) char text[200];
strcpy(text, m_szModuleName);
- char *tDest = text + strlen(text);
+ char *tDest = text + mir_strlen(text);
CLISTMENUITEM mi = { sizeof(mi) };
mi.pszService = text;
@@ -421,9 +421,9 @@ void TwitterProto::SendTweetWorker(void *p) return;
char *text = static_cast<char*>(p);
- if (strlen(text) > 140) { // looks like the chat max outgoing msg thing doesn't work, so i'll do it here.
+ if (mir_strlen(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, SIZEOF(errorPopup), _T("Don't be crazy! Everyone knows the max tweet size is 140, and you're trying to fit %d chars in there?"), strlen(text));
+ mir_sntprintf(errorPopup, SIZEOF(errorPopup), _T("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;
}
diff --git a/protocols/Twitter/src/ui.cpp b/protocols/Twitter/src/ui.cpp index 4d696207a1..00ed1aab76 100644 --- a/protocols/Twitter/src/ui.cpp +++ b/protocols/Twitter/src/ui.cpp @@ -83,7 +83,7 @@ INT_PTR CALLBACK first_run_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM TCHAR tstr[128];
GetDlgItemTextA(hwndDlg, IDC_SERVER, str, SIZEOF(str) - 1);
- if (str[strlen(str) - 1] != '/')
+ if (str[mir_strlen(str) - 1] != '/')
strncat(str, "/", SIZEOF(str) - mir_strlen(str));
db_set_s(0, proto->ModuleName(), TWITTER_KEY_BASEURL, str);
@@ -148,7 +148,7 @@ INT_PTR CALLBACK tweet_proc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam case WM_SETREPLY:
char foo[512];
mir_snprintf(foo, SIZEOF(foo), "@%s ", (char*)wParam);
- size_t len = strlen(foo);
+ size_t len = mir_strlen(foo);
SetDlgItemTextA(hwndDlg, IDC_TWEETMSG, foo);
SendDlgItemMessage(hwndDlg, IDC_TWEETMSG, EM_SETSEL, len, len);
@@ -230,7 +230,7 @@ INT_PTR CALLBACK options_proc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar db_set_s(0, proto->ModuleName(), TWITTER_KEY_UN, str);
GetDlgItemTextA(hwndDlg, IDC_BASEURL, str, SIZEOF(str) - 1);
- if (str[strlen(str) - 1] != '/')
+ if (str[mir_strlen(str) - 1] != '/')
strncat(str, "/", SIZEOF(str) - mir_strlen(str));
db_set_s(0, proto->ModuleName(), TWITTER_KEY_BASEURL, str);
diff --git a/protocols/WhatsApp/src/theme.cpp b/protocols/WhatsApp/src/theme.cpp index b95e7649b2..768ad6cccf 100644 --- a/protocols/WhatsApp/src/theme.cpp +++ b/protocols/WhatsApp/src/theme.cpp @@ -49,7 +49,7 @@ int WhatsAppProto::OnBuildStatusMenu(WPARAM wParam, LPARAM lParam) {
char text[200];
strcpy(text, m_szModuleName);
- char *tDest = text + strlen(text);
+ char *tDest = text + mir_strlen(text);
CLISTMENUITEM mi = { sizeof(mi) };
mi.pszService = text;
diff --git a/protocols/Xfire/src/Xfire_base.cpp b/protocols/Xfire/src/Xfire_base.cpp index 6cf65879c9..a3247c4301 100644 --- a/protocols/Xfire/src/Xfire_base.cpp +++ b/protocols/Xfire/src/Xfire_base.cpp @@ -11,7 +11,7 @@ BYTE Xfire_base::accStringByte(char* str){ if (str == NULL)
return 0;
- for (unsigned int i = 0; i < (int)strlen(str); i++)
+ for (unsigned int i = 0; i < (int)mir_strlen(str); i++)
{
temp += str[i];
}
@@ -27,7 +27,7 @@ void Xfire_base::strtolower(char*str) return;
//lowercase it :)
- for (unsigned int i = 0; i < (int)strlen(str); i++)
+ for (unsigned int i = 0; i < (int)mir_strlen(str); i++)
{
str[i] = tolower(str[i]);
}
@@ -54,7 +54,7 @@ void Xfire_base::strtoupper(char*str) return;
//lowercase it :)
- for (unsigned int i = 0; i < (int)strlen(str); i++)
+ for (unsigned int i = 0; i < (int)mir_strlen(str); i++)
{
str[i] = toupper(str[i]);
}
@@ -68,7 +68,7 @@ void Xfire_base::setString(char*from, char**to) return;
//stringgröße auslesen
- int size = strlen(from);
+ int size = mir_strlen(from);
//bestehenden zielpointer leeren
if (*to != NULL)
@@ -89,8 +89,8 @@ void Xfire_base::appendString(char*from, char**to) return;
//stringgröße auslesen
- int size = strlen(from);
- int size2 = strlen(*to);
+ int size = mir_strlen(from);
+ int size2 = mir_strlen(*to);
//temporären pointer anlegen
char* append = new char[size + size2 + 1];
@@ -329,8 +329,8 @@ BOOL Xfire_base::inString(char*str, char*search, char**pos) { }
//ist der gesuchte string größer, wie der string wo gesucht werden soll? dann FALSE zurück
- unsigned int sizeofsearch = strlen(search);
- if (sizeofsearch > strlen(str))
+ unsigned int sizeofsearch = mir_strlen(search);
+ if (sizeofsearch > mir_strlen(str))
{
//poszeiger, falls übergeben, auf NULL setzen
if (pos) *pos = NULL;
@@ -389,7 +389,7 @@ void Xfire_base::strreplace(char*search, char*replace, char**data) { //ersetzendes anhängen
this->appendString(replace, &newdata);
//poszeiger um die größe des zusuchenden strings erhöhen
- pos += strlen(search);
+ pos += mir_strlen(search);
//rest anhängen
this->appendString(pos, &newdata);
//alten string löschen
diff --git a/protocols/Xfire/src/Xfire_game.cpp b/protocols/Xfire/src/Xfire_game.cpp index 12acb76b07..167495b2d6 100644 --- a/protocols/Xfire/src/Xfire_game.cpp +++ b/protocols/Xfire/src/Xfire_game.cpp @@ -23,7 +23,7 @@ BOOL Xfire_game::start_game(char*ip, unsigned int port, char*pw) { return FALSE;
//ist launchparam großgenug für eibne urlprüfung?
- if (strlen(this->launchparams) > 5)
+ if (mir_strlen(this->launchparams) > 5)
{
//launchparams ne url? dann openurl funktion von miranda verwenden
if (this->launchparams[0] == 'h'&&
@@ -49,10 +49,10 @@ BOOL Xfire_game::start_game(char*ip, unsigned int port, char*pw) { //größe des netzwerparams berechnen
if (this->pwparams)
- pwsize += strlen(this->pwparams);
+ pwsize += mir_strlen(this->pwparams);
- mynetworkparams = new char[strlen(this->networkparams) + pwsize];
- strcpy_s(mynetworkparams, strlen(this->networkparams) + pwsize, this->networkparams);
+ mynetworkparams = new char[mir_strlen(this->networkparams) + pwsize];
+ strcpy_s(mynetworkparams, mir_strlen(this->networkparams) + pwsize, this->networkparams);
//port begrenzen
port = port % 65535;
@@ -92,19 +92,19 @@ BOOL Xfire_game::start_game(char*ip, unsigned int port, char*pw) { }
if (mynetworkparams)
- networksize = strlen(mynetworkparams) + strlen(this->networkparams);
+ networksize = mir_strlen(mynetworkparams) + mir_strlen(this->networkparams);
}
//extra parameter
int extraparamssize = 0;
if (this->extraparams)
{
- extraparamssize = strlen(this->extraparams);
+ extraparamssize = mir_strlen(this->extraparams);
}
//temporäres array anlegen
char*temp = NULL;
- temp = new char[strlen(this->launchparams) + networksize + extraparamssize + 1];
+ temp = new char[mir_strlen(this->launchparams) + networksize + extraparamssize + 1];
if (temp == NULL)
{
@@ -116,7 +116,7 @@ BOOL Xfire_game::start_game(char*ip, unsigned int port, char*pw) { }
//launcherstring ins temporäre array
- strcpy_s(temp, strlen(this->launchparams) + 1, this->launchparams);
+ strcpy_s(temp, mir_strlen(this->launchparams) + 1, this->launchparams);
//netzwerkparameter ?
if (mynetworkparams)
@@ -289,7 +289,7 @@ void Xfire_game::readFromDB(unsigned dbid) if (this->path)
{
BOOL found = FALSE;
- for (unsigned int i = 0; i < strlen(this->path); i++)
+ for (unsigned int i = 0; i < mir_strlen(this->path); i++)
{
if (this->path[i] == '~')
{
diff --git a/protocols/Xfire/src/addgamedialog.cpp b/protocols/Xfire/src/addgamedialog.cpp index 7d1aefb1c0..3c8f50ada9 100644 --- a/protocols/Xfire/src/addgamedialog.cpp +++ b/protocols/Xfire/src/addgamedialog.cpp @@ -267,7 +267,7 @@ BOOL OpenFileDialog(HWND hwndDlg, OPENFILENAMEA*ofn, char*exe) { //filterstring aufbauen
mir_snprintf(szFilter, SIZEOF(szFilter), "%s|%s|%s|*.*|", exename, exename, Translate("All Files"));
//umbruch in 0 wandeln
- unsigned int sizeFilter = strlen(szFilter);
+ unsigned int sizeFilter = mir_strlen(szFilter);
for (unsigned int i = 0; i < sizeFilter; i++)
if (szFilter[i] == '|') szFilter[i] = 0;
//openfiledia vorbereiten
@@ -629,7 +629,7 @@ INT_PTR CALLBACK DlgAddGameProc2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM //Spielname
GetDlgItemTextA(hwndDlg, IDC_ADD_NAME, temp, SIZEOF(temp));
- if (!strlen(temp))
+ if (!mir_strlen(temp))
{
if (!editgame) delete newgame;
return MessageBox(hwndDlg, TranslateT("Please enter a game name."), TranslateT("XFire Options"), MB_OK | MB_ICONEXCLAMATION);
@@ -644,7 +644,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));
- if (!strlen(temp))
+ if (!mir_strlen(temp))
{
if (!editgame) delete newgame;
return MessageBox(hwndDlg, TranslateT("Please enter a game ID."), TranslateT("XFire Options"), MB_OK | MB_ICONEXCLAMATION);
@@ -672,7 +672,7 @@ INT_PTR CALLBACK DlgAddGameProc2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM }
//zu sendene spielid
GetDlgItemTextA(hwndDlg, IDC_ADD_SENDID, temp, SIZEOF(temp));
- if (strlen(temp))
+ if (mir_strlen(temp))
{
//standardmäßig wird bei einem customeintrag keine id versendet
int sendid = atoi(temp);
@@ -682,7 +682,7 @@ INT_PTR CALLBACK DlgAddGameProc2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM //launcher exe
GetDlgItemTextA(hwndDlg, IDC_ADD_LAUNCHEREXE, temp, SIZEOF(temp));
- if (strlen(temp))
+ if (mir_strlen(temp))
{
//lowercase pfad
newgame->strtolower(temp);
@@ -691,7 +691,7 @@ INT_PTR CALLBACK DlgAddGameProc2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM }
//detectexe
GetDlgItemTextA(hwndDlg, IDC_ADD_DETECTEXE, temp, SIZEOF(temp));
- if (!strlen(temp))
+ if (!mir_strlen(temp))
{
if (!editgame) delete newgame;
return MessageBox(hwndDlg, TranslateT("Please select a game exe. Note: If you don't select a launcher exe, the game exe will be used in the game start menu."), TranslateT("XFire Options"), MB_OK | MB_ICONEXCLAMATION);
@@ -709,13 +709,13 @@ INT_PTR CALLBACK DlgAddGameProc2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM }
//mustcontain parameter
GetDlgItemTextA(hwndDlg, IDC_ADD_CUSTOMPARAMS, temp, SIZEOF(temp));
- if (strlen(temp))
+ if (mir_strlen(temp))
{
newgame->setString(temp, &newgame->mustcontain);
}
//statusmsg speichern
GetDlgItemTextA(hwndDlg, IDC_ADD_STATUSMSG, temp, SIZEOF(temp));
- if (strlen(temp))
+ if (mir_strlen(temp))
{
newgame->setString(temp, &newgame->statusmsg);
newgame->setstatusmsg = 1;
diff --git a/protocols/Xfire/src/clientinformationpacket.cpp b/protocols/Xfire/src/clientinformationpacket.cpp index f0d65e8a00..7843c6d8a8 100644 --- a/protocols/Xfire/src/clientinformationpacket.cpp +++ b/protocols/Xfire/src/clientinformationpacket.cpp @@ -39,17 +39,17 @@ namespace xfirelib { packet[index++] = 0x01; packet[index++] = (char)skins; packet[index++] = 0x00; - packet[index++] = strlen("Standard"); + packet[index++] = mir_strlen("Standard"); packet[index++] = 0x00; - memcpy(packet+index,"Standard",strlen("Standard"));/*add first skin name*/ - index += strlen("Standard"); + memcpy(packet+index,"Standard",mir_strlen("Standard"));/*add first skin name*/ + index += mir_strlen("Standard"); - packet[index++] = strlen("XFire"); + packet[index++] = mir_strlen("XFire"); packet[index++] = 0x00; - memcpy(packet+index,"XFire",strlen("XFire"));/*add second skin name*/ - index += strlen("XFire"); + memcpy(packet+index,"XFire",mir_strlen("XFire"));/*add second skin name*/ + index += mir_strlen("XFire"); VariableValue val; val.setName( "version" ); diff --git a/protocols/Xfire/src/clientloginpacket.cpp b/protocols/Xfire/src/clientloginpacket.cpp index f46b0cd21e..97c1478ceb 100644 --- a/protocols/Xfire/src/clientloginpacket.cpp +++ b/protocols/Xfire/src/clientloginpacket.cpp @@ -105,7 +105,7 @@ void ClientLoginPacket::hashSha1(const char *string, unsigned char *sha){ unsigned char temp[1024]; CSHA1 sha1; sha1.Reset(); - sha1.Update((UINT_8 *)string, strlen(string)); + sha1.Update((UINT_8 *)string, mir_strlen(string)); sha1.Final(); sha1.GetHash(temp); diff --git a/protocols/Xfire/src/main.cpp b/protocols/Xfire/src/main.cpp index ff8e1b947d..f2aac56cde 100644 --- a/protocols/Xfire/src/main.cpp +++ b/protocols/Xfire/src/main.cpp @@ -274,7 +274,7 @@ void XFireClient::handlingBuddy(MCONTACT handle) }
void XFireClient::setNick(char*nnick) {
- /*if (strlen(nnick)==0)
+ /*if (mir_strlen(nnick)==0)
return;*/
SendNickChangePacket nick;
nick.nick = nnick;
@@ -284,7 +284,7 @@ void XFireClient::setNick(char*nnick) { void XFireClient::sendmsg(char*usr, char*cmsg) {
SendMessagePacket msg;
- // if (strlen(cmsg)>255)
+ // if (mir_strlen(cmsg)>255)
// *(cmsg+255)=0;
msg.init(client, usr, cmsg);
client->send(&msg);
@@ -845,7 +845,7 @@ INT_PTR UrlCall(WPARAM wparam, LPARAM lparam) { //tempbuffer für die frage and en user
char temp[100];
- if (strlen(g) > 25) //zugroße abschneiden
+ 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);
@@ -1601,10 +1601,10 @@ MCONTACT CList_AddContact(XFireContact xfc, bool InList, bool SetOnline, int cla db_set_b(hContact, "CList", "NotOnList", 1);
db_unset(hContact, "CList", "Hidden");
- if (strlen(xfc.nick) > 0) {
+ if (mir_strlen(xfc.nick) > 0) {
db_set_utf(hContact, protocolname, "Nick", xfc.nick);
}
- else if (strlen(xfc.username) > 0) {
+ else if (mir_strlen(xfc.username) > 0) {
db_set_s(hContact, protocolname, "Nick", xfc.username);
}
@@ -1624,7 +1624,7 @@ MCONTACT CList_AddContact(XFireContact xfc, bool InList, bool SetOnline, int cla {
XFire_SetAvatar* xsa = new XFire_SetAvatar;
xsa->hContact = hContact;
- xsa->username = new char[strlen(xfc.username) + 1];
+ xsa->username = new char[mir_strlen(xfc.username) + 1];
strcpy(xsa->username, xfc.username);
mir_forkthread(SetAvatar, (LPVOID)xsa);
}
@@ -1925,7 +1925,7 @@ static INT_PTR GetIPPort(WPARAM hContact, LPARAM lParam) if (OpenClipboard(NULL)) {
EmptyClipboard();
- HGLOBAL clipbuffer = GlobalAlloc(GMEM_DDESHARE, strlen(temp) + 1);
+ HGLOBAL clipbuffer = GlobalAlloc(GMEM_DDESHARE, mir_strlen(temp) + 1);
char *buffer = (char*)GlobalLock(clipbuffer);
strcpy(buffer, LPCSTR(temp));
GlobalUnlock(clipbuffer);
@@ -1953,7 +1953,7 @@ static INT_PTR GetVIPPort(WPARAM hContact, LPARAM lParam) if (OpenClipboard(NULL)) {
EmptyClipboard();
- HGLOBAL clipbuffer = GlobalAlloc(GMEM_DDESHARE, strlen(temp) + 1);
+ HGLOBAL clipbuffer = GlobalAlloc(GMEM_DDESHARE, mir_strlen(temp) + 1);
char *buffer = (char*)GlobalLock(clipbuffer);
strcpy(buffer, LPCSTR(temp));
GlobalUnlock(clipbuffer);
@@ -2612,7 +2612,7 @@ if (db_get(entry->hcontact,"ContactPhoto", "File",&dbv)) {
XFire_SetAvatar* xsa=new XFire_SetAvatar;
xsa->hContact=entry->hcontact;
-xsa->username=new char[strlen(entry->username.c_str())+1];
+xsa->username=new char[mir_strlen(entry->username.c_str())+1];
strcpy(xsa->username,entry->username.c_str());
mir_forkthread(SetAvatar,(LPVOID)xsa);
@@ -2703,7 +2703,7 @@ MCONTACT handlingBuddys(BuddyListEntry *entry, int clan, char*group, BOOL dontsc DummyXFireGame *gameob;
- if (strlen(entry->gameinfo.c_str()) > 0)
+ if (mir_strlen(entry->gameinfo.c_str()) > 0)
db_set_s(hContact, protocolname, "GameInfo", entry->gameinfo.c_str());
//beim voicechat foglendes machn
@@ -2790,7 +2790,7 @@ MCONTACT handlingBuddys(BuddyListEntry *entry, int clan, char*group, BOOL dontsc if (entry->lastpopup == NULL)
{
//größe des popupstrings
- int size = strlen(temp) + 1;
+ int size = mir_strlen(temp) + 1;
//popup darstellen
displayPopup(NULL, temp, PLUGIN_TITLE, 0, hicongame);
//letzten popup definieren
@@ -2806,7 +2806,7 @@ MCONTACT handlingBuddys(BuddyListEntry *entry, int clan, char*group, BOOL dontsc entry->lastpopup = NULL;
//größe des popupstrings
- int size = strlen(temp) + 1;
+ int size = mir_strlen(temp) + 1;
//popup darstellen
displayPopup(NULL, temp, PLUGIN_TITLE, 0, hicongame);
//letzten popup definieren
@@ -3140,7 +3140,7 @@ INT_PTR SetAwayMsg(WPARAM wParam, LPARAM lParam) strcpy(statusmessage[0], (char*)lParam);
}
else if (wParam != ID_STATUS_OFFLINE) {
- if (db_get_b(NULL, protocolname, "nocustomaway", 0) == 0 && strlen((char*)lParam) > 0) {
+ 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);
//strcpy(statusmessage[1],( char* )lParam);
}
diff --git a/protocols/Xfire/src/options.cpp b/protocols/Xfire/src/options.cpp index 127f789b19..c108822805 100644 --- a/protocols/Xfire/src/options.cpp +++ b/protocols/Xfire/src/options.cpp @@ -104,7 +104,7 @@ static mytreeitem mytree[] = { //funktion zum auslesen aller einträge unter XFireBlock static int enumSettingsProc(const char *szSetting, LPARAM lParam) { - if (strlen(szSetting) > 0) + if (mir_strlen(szSetting) > 0) { SendDlgItemMessageA((HWND)lParam, IDC_BLOCKUSER, LB_ADDSTRING, 0, (LPARAM)szSetting); } @@ -895,7 +895,7 @@ static INT_PTR CALLBACK DlgProcOpts6(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR char* buffer; EmptyClipboard(); - clipbuffer = GlobalAlloc(GMEM_DDESHARE, strlen(out)+1); + clipbuffer = GlobalAlloc(GMEM_DDESHARE, mir_strlen(out)+1); buffer = (char*)GlobalLock(clipbuffer); strcpy(buffer, LPCSTR(out)); GlobalUnlock(clipbuffer); diff --git a/protocols/Xfire/src/searching4games.cpp b/protocols/Xfire/src/searching4games.cpp index 9796d02414..a73e624d56 100644 --- a/protocols/Xfire/src/searching4games.cpp +++ b/protocols/Xfire/src/searching4games.cpp @@ -68,7 +68,7 @@ BOOL CheckPath(char*ppath, char*pathwildcard = NULL) char temp[XFIRE_MAX_STATIC_STRING_LEN];
strncpy(temp, ppath,XFIRE_MAX_STATIC_STRING_LEN-1);
- *(temp + strlen(temp) - 1) = 0;
+ *(temp + mir_strlen(temp) - 1) = 0;
strncat(temp, wfd.cFileName, SIZEOF(temp) - mir_strlen(temp));
strncat(temp, "\\", SIZEOF(temp) - mir_strlen(temp));
strncat(temp, pos, SIZEOF(temp) - mir_strlen(temp));
@@ -328,7 +328,7 @@ void Scan4Games(LPVOID lparam) //zusätzlichen pfad anhängen
if (xfire_GetPrivateProfileString(temp, "LauncherDirAppend", "", ret2, 255, inipath))
{
- if (*(path + strlen(path) - 1) == '\\'&&*(ret2) == '\\')
+ if (*(path + mir_strlen(path) - 1) == '\\'&&*(ret2) == '\\')
strcat(path, (ret2 + 1));
else
strcat(path, ret2);
@@ -350,11 +350,11 @@ void Scan4Games(LPVOID lparam) if (pos != 0)
*pos = 0;
- if (*(path + strlen(path) - 1) != '\\')
- *(path + strlen(path) - strlen(ret2)) = 0;
+ if (*(path + mir_strlen(path) - 1) != '\\')
+ *(path + mir_strlen(path) - mir_strlen(ret2)) = 0;
}
- if (*(path + strlen(path) - 1) != '\\')
+ if (*(path + mir_strlen(path) - 1) != '\\')
strcat(path, "\\");
@@ -369,7 +369,7 @@ void Scan4Games(LPVOID lparam) {
if (xfire_GetPrivateProfileString(temp, "DetectExe", "", ret, 255, inipath))
{
- cutforlaunch = path + strlen(path);
+ cutforlaunch = path + mir_strlen(path);
strcpy(pathtemp, path);
//wenn backslash bei detectexe, dann diesen skippen (eveonline bug)
@@ -393,7 +393,7 @@ void Scan4Games(LPVOID lparam) }
else if (xfire_GetPrivateProfileString(temp, "LauncherExe", "", ret2, 255, inipath))
{
- cutforlaunch = path + strlen(path);
+ cutforlaunch = path + mir_strlen(path);
strcat(path, ret2);
}
}
@@ -404,7 +404,7 @@ void Scan4Games(LPVOID lparam) }
else if (xfire_GetPrivateProfileString(temp, "DetectExe[0]", "", ret2, 255, inipath))
{
- cutforlaunch = path + strlen(path);
+ cutforlaunch = path + mir_strlen(path);
strcat(path, ret2);
multiexe = TRUE;
if (!CheckPath(path, path_r))
@@ -414,7 +414,7 @@ void Scan4Games(LPVOID lparam) }
else if (xfire_GetPrivateProfileString(temp, "DetectExe", "", ret2, 255, inipath))
{
- cutforlaunch = path + strlen(path);
+ cutforlaunch = path + mir_strlen(path);
//wenn backslash bei detectexe, dann diesen skippen (eveonline bug)
if (ret2[0] == '\\')
@@ -433,7 +433,7 @@ void Scan4Games(LPVOID lparam) }
else if (xfire_GetPrivateProfileString(temp, "LauncherExe", "", ret2, 255, inipath))
{
- cutforlaunch = path + strlen(path);
+ cutforlaunch = path + mir_strlen(path);
strcat(path, ret2);
}
@@ -448,7 +448,7 @@ void Scan4Games(LPVOID lparam) //GetLongPathNameA(path,path,sizeof(path));
//lowercase pfad
- for (unsigned int ii = 0; ii < strlen(path); ii++)
+ for (unsigned int ii = 0; ii < mir_strlen(path); ii++)
path[ii] = tolower(path[ii]);
if (path_r[0] == 0)
@@ -456,7 +456,7 @@ void Scan4Games(LPVOID lparam) else
{
//lowercase wildcard pfad
- for (unsigned int ii = 0; ii < strlen(path_r); ii++)
+ for (unsigned int ii = 0; ii < mir_strlen(path_r); ii++)
path_r[ii] = tolower(path_r[ii]);
newgame->setString(path_r, &newgame->path);
}
@@ -483,10 +483,10 @@ void Scan4Games(LPVOID lparam) }
else
{
- for (unsigned int i2 = 0; i2 < strlen(path); i2++)
+ for (unsigned int i2 = 0; i2 < mir_strlen(path); i2++)
path[i2] = tolower(path[i2]);
- char* mpathtemp = new char[strlen(path) + 1];
+ char* mpathtemp = new char[mir_strlen(path) + 1];
strcpy(mpathtemp, path);
newgame->mpath.push_back(mpathtemp);
}
@@ -508,7 +508,7 @@ void Scan4Games(LPVOID lparam) char launchpath[XFIRE_MAX_STATIC_STRING_LEN] = "";
strcpy(launchpath, path);
//letzten backslash entfernen
- if (launchpath[strlen(launchpath) - 1] == '\\') launchpath[strlen(launchpath) - 1] = 0;
+ if (launchpath[mir_strlen(launchpath) - 1] == '\\') launchpath[mir_strlen(launchpath) - 1] = 0;
strcat(path, ret2);
@@ -608,7 +608,7 @@ void Scan4Games(LPVOID lparam) //GetLongPathNameA(ret2,ret2,sizeof(ret2));
//lowercase pfad
- for (unsigned int i = 0; i < strlen(ret2); i++)
+ for (unsigned int i = 0; i < mir_strlen(ret2); i++)
ret2[i] = tolower(ret2[i]);
newgame->setString(ret2, &newgame->path);
@@ -722,7 +722,7 @@ void Scan4Games(LPVOID lparam) if (!db_get_b(NULL, protocolname, "dontdisresults", 0))
{
- int p = strlen(gamelist) - 2;
+ 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);
diff --git a/protocols/Xfire/src/tools.cpp b/protocols/Xfire/src/tools.cpp index 7675e55762..f2783b6be3 100644 --- a/protocols/Xfire/src/tools.cpp +++ b/protocols/Xfire/src/tools.cpp @@ -65,13 +65,13 @@ BOOL str_replace(char*src, char*find, char*rep) if (pos > -1) { - char *temp = new char[strlen(src) + strlen(rep) + 1]; + char *temp = new char[mir_strlen(src) + mir_strlen(rep) + 1]; strcpy(temp, src); *(temp + pos) = 0; strcat(temp, rep); - strcat(temp, (src + pos + strlen(find))); + strcat(temp, (src + pos + mir_strlen(find))); strcpy(src, temp); delete[] temp; @@ -134,7 +134,7 @@ char*menuitemtext(char*mtext) if (!mtext) return NULL; - int size = strlen(mtext); + int size = mir_strlen(mtext); if (!size || size > 255) return mtext; @@ -739,7 +739,7 @@ char * getItem(char * string, char delim, int count) if (count > 1) item[0] = 0; - for (unsigned int i = 0; i < strlen(item); i++) + for (unsigned int i = 0; i < mir_strlen(item); i++) { item[i] = tolower(item[i]); } @@ -831,19 +831,19 @@ BOOL checkCommandLine(HANDLE hProcess, char * mustcontain, char * mustnotcontain buffer2[correctsize - 1] = 0; - for (unsigned int i = 0; i < strlen(buffer2); i++) + for (unsigned int i = 0; i < mir_strlen(buffer2); i++) { buffer2[i] = tolower(buffer2[i]); } //lowercase mustcontain/mustnotcontain if (mustcontain) - for (unsigned int i = 0; i < strlen(mustcontain); i++) + for (unsigned int i = 0; i < mir_strlen(mustcontain); i++) { mustcontain[i] = tolower(mustcontain[i]); } if (mustnotcontain) - for (unsigned int i = 0; i < strlen(mustnotcontain); i++) + for (unsigned int i = 0; i < mir_strlen(mustnotcontain); i++) { mustnotcontain[i] = tolower(mustnotcontain[i]); } @@ -1015,7 +1015,7 @@ unsigned int getfilesize(char*path) //funktion soll erst in der userini suchen, danach in der xfire_games.ini DWORD xfire_GetPrivateProfileString(__in LPCSTR lpAppName, __in LPCSTR lpKeyName, __in LPCSTR lpDefault, __out LPSTR lpReturnedString, __in DWORD nSize, __in LPCSTR lpFileName) { //xfire_games.ini - int size = strlen(lpFileName); + int size = mir_strlen(lpFileName); if (size > 15) { char*file = (char*)lpFileName; diff --git a/protocols/Xfire/src/userdetails.cpp b/protocols/Xfire/src/userdetails.cpp index 2b3cdb9681..4a38300ca6 100644 --- a/protocols/Xfire/src/userdetails.cpp +++ b/protocols/Xfire/src/userdetails.cpp @@ -101,7 +101,7 @@ static int GetIPPortUDetails(MCONTACT hContact, char* feld1, char* feld2) if (OpenClipboard(NULL)) {
EmptyClipboard();
- HGLOBAL clipbuffer = GlobalAlloc(GMEM_DDESHARE, strlen(temp) + 1);
+ HGLOBAL clipbuffer = GlobalAlloc(GMEM_DDESHARE, mir_strlen(temp) + 1);
char *buffer = (char*)GlobalLock(clipbuffer);
strcpy(buffer, LPCSTR(temp));
GlobalUnlock(clipbuffer);
@@ -254,7 +254,7 @@ static INT_PTR CALLBACK DlgProcUserDetails(HWND hwndDlg, UINT msg, WPARAM wParam DBVARIANT dbv;
if (!db_get(hContact, protocolname, "Username", &dbv))
{
- int usernamesize = strlen(dbv.pszVal) + 1;
+ int usernamesize = mir_strlen(dbv.pszVal) + 1;
char* username = new char[usernamesize];
if (username)
{
diff --git a/protocols/Xfire/src/xfireparse.cpp b/protocols/Xfire/src/xfireparse.cpp index 4f872f4401..382901f853 100644 --- a/protocols/Xfire/src/xfireparse.cpp +++ b/protocols/Xfire/src/xfireparse.cpp @@ -32,7 +32,7 @@ XFireParse::XFireParse() { /*void XFireParse::readVariableAttribut( char *value, char *packet, char *attr,int packet_length,int attr_length, int start,int max_length ) { -int length_index = findString2(packet,attr, packet_length,strlen(attr),start)+attr_length+1; +int length_index = findString2(packet,attr, packet_length,mir_strlen(attr),start)+attr_length+1; unsigned int length = xfire_hex_to_intC(packet[length_index]); diff --git a/protocols/Xfire/src/xfireutils.cpp b/protocols/Xfire/src/xfireutils.cpp index 5df7ba314b..93793c72e7 100644 --- a/protocols/Xfire/src/xfireutils.cpp +++ b/protocols/Xfire/src/xfireutils.cpp @@ -36,9 +36,9 @@ using namespace std; } int XFireUtils::addAttributName(char *packet,int packet_length, char *att){ - XDEBUG3( "Adding %d chars at position %d\n",strlen(att),packet_length); - packet[packet_length] = (char)strlen(att);//set att length - memcpy(packet+packet_length+1,att,strlen(att)); //set attname - return packet_length+1+strlen(att); + XDEBUG3( "Adding %d chars at position %d\n",mir_strlen(att),packet_length); + packet[packet_length] = (char)mir_strlen(att);//set att length + memcpy(packet+packet_length+1,att,mir_strlen(att)); //set attname + return packet_length+1+mir_strlen(att); } }; |