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/Gadu-Gadu/src | |
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/Gadu-Gadu/src')
-rw-r--r-- | protocols/Gadu-Gadu/src/avatar.cpp | 8 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/src/core.cpp | 2 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/src/dialogs.cpp | 4 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/src/dynstuff.cpp | 8 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/src/filetransfer.cpp | 12 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/src/gg.cpp | 4 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/src/gg_proto.cpp | 44 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/src/import.cpp | 2 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/src/oauth.cpp | 24 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/src/ownerinfo.cpp | 2 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/src/services.cpp | 2 | ||||
-rw-r--r-- | protocols/Gadu-Gadu/src/userutils.cpp | 2 |
12 files changed, 57 insertions, 57 deletions
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
|