From 5a17c9299e03bebf46169927abdeee34aaf8e854 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Fri, 22 May 2015 10:06:32 +0000 Subject: replace strlen to mir_strlen git-svn-id: http://svn.miranda-ng.org/main/trunk@13747 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/netlib/netlibautoproxy.cpp | 8 ++++---- src/modules/netlib/netlibhttp.cpp | 6 +++--- src/modules/netlib/netliblog.cpp | 2 +- src/modules/netlib/netlibopenconn.cpp | 4 ++-- src/modules/netlib/netlibsecurity.cpp | 4 ++-- src/modules/netlib/netlibupnp.cpp | 10 +++++----- 6 files changed, 17 insertions(+), 17 deletions(-) (limited to 'src/modules/netlib') diff --git a/src/modules/netlib/netlibautoproxy.cpp b/src/modules/netlib/netlibautoproxy.cpp index 2de498752e..df46abd73b 100644 --- a/src/modules/netlib/netlibautoproxy.cpp +++ b/src/modules/netlib/netlibautoproxy.cpp @@ -299,8 +299,8 @@ static void NetlibIeProxyThread(void *arg) char *proxy = proxyBuffer; DWORD dwProxyLen = sizeof(proxyBuffer); - if (pInternetGetProxyInfo(param->szUrl, (DWORD)strlen(param->szUrl), - param->szHost, (DWORD)strlen(param->szHost), &proxy, &dwProxyLen)) + if (pInternetGetProxyInfo(param->szUrl, (DWORD)mir_strlen(param->szUrl), + param->szHost, (DWORD)mir_strlen(param->szHost), &proxy, &dwProxyLen)) param->szProxy = mir_strdup(lrtrim(proxy)); NetlibLogf(NULL, "Autoproxy got response %s, Param: %s %s", param->szProxy, param->szUrl, param->szHost); @@ -341,7 +341,7 @@ char* NetlibGetIeProxy(char *szUrl) if (ind < 0 || !szProxyHost[ind]) return NULL; - size_t len = strlen(szHost) + 20; + size_t len = mir_strlen(szHost) + 20; res = (char*)mir_alloc(len); mir_snprintf(res, len, "%s %s", ind == 2 ? "SOCKS" : "PROXY", szProxyHost[ind]); return res; @@ -408,7 +408,7 @@ void NetlibLoadIeProxy(void) szProxyHost[ind] = mir_strdup(szProxy); else { - size_t len = strlen(szProxy) + 10; + size_t len = mir_strlen(szProxy) + 10; szProxyHost[ind] = (char*)mir_alloc(len); mir_snprintf(szProxyHost[ind], len, "%s:%u", szProxy, ind == 2 ? 1080 : 8080); } diff --git a/src/modules/netlib/netlibhttp.cpp b/src/modules/netlib/netlibhttp.cpp index 7d6734ce8f..0fa5d91f42 100644 --- a/src/modules/netlib/netlibhttp.cpp +++ b/src/modules/netlib/netlibhttp.cpp @@ -324,7 +324,7 @@ static int HttpPeekFirstResponseLine(NetlibConnection *nlc, DWORD dwTimeoutTime, if ((peol = strchr(buffer, '\n')) != NULL) break; - if ((int)strlen(buffer) < bytesPeeked) { + if ((int)mir_strlen(buffer) < bytesPeeked) { SetLastError(ERROR_BAD_FORMAT); return 0; } @@ -578,10 +578,10 @@ INT_PTR NetlibHttpSendRequest(WPARAM wParam, LPARAM lParam) phost = strstr(pszFullUrl, "://"); phost = phost ? phost + 3 : pszFullUrl; ppath = strchr(phost, '/'); - rlen = ppath ? ppath - pszFullUrl : strlen(pszFullUrl); + rlen = ppath ? ppath - pszFullUrl : mir_strlen(pszFullUrl); } - nlc->szNewUrl = (char*)mir_realloc(nlc->szNewUrl, rlen + strlen(tmpUrl) * 3 + 1); + nlc->szNewUrl = (char*)mir_realloc(nlc->szNewUrl, rlen + mir_strlen(tmpUrl) * 3 + 1); strncpy(nlc->szNewUrl, pszFullUrl, rlen); strcpy(nlc->szNewUrl + rlen, tmpUrl); diff --git a/src/modules/netlib/netliblog.cpp b/src/modules/netlib/netliblog.cpp index 5590d2305c..e673ae8561 100644 --- a/src/modules/netlib/netliblog.cpp +++ b/src/modules/netlib/netliblog.cpp @@ -337,7 +337,7 @@ static INT_PTR NetlibLog(WPARAM wParam, LPARAM lParam) } if (logOptions.toFile && !logOptions.tszFile.IsEmpty()) { - size_t len = strlen(pszMsg); + size_t len = mir_strlen(pszMsg); mir_writeLogA(hLogger, "%s%s%s", szHead, pszMsg, pszMsg[len-1] == '\n' ? "" : "\r\n"); } diff --git a/src/modules/netlib/netlibopenconn.cpp b/src/modules/netlib/netlibopenconn.cpp index c7daa9dea2..0e40641eec 100644 --- a/src/modules/netlib/netlibopenconn.cpp +++ b/src/modules/netlib/netlibopenconn.cpp @@ -115,8 +115,8 @@ static int NetlibInitSocks4Connection(NetlibConnection *nlc, NetlibUser *nlu, NE // http://www.socks.nec.com/protocol/socks4.protocol and http://www.socks.nec.com/protocol/socks4a.protocol if (!nloc || !nloc->szHost || !nloc->szHost[0]) return 0; - size_t nHostLen = strlen(nloc->szHost) + 1; - size_t nUserLen = nlu->settings.szProxyAuthUser ? strlen(nlu->settings.szProxyAuthUser) + 1 : 1; + size_t nHostLen = mir_strlen(nloc->szHost) + 1; + size_t nUserLen = nlu->settings.szProxyAuthUser ? mir_strlen(nlu->settings.szProxyAuthUser) + 1 : 1; size_t len = 8 + nUserLen; char* pInit = (char*)alloca(len + nHostLen); diff --git a/src/modules/netlib/netlibsecurity.cpp b/src/modules/netlib/netlibsecurity.cpp index 4f47cbf2d8..0e4151d1ad 100644 --- a/src/modules/netlib/netlibsecurity.cpp +++ b/src/modules/netlib/netlibsecurity.cpp @@ -383,7 +383,7 @@ char* NtlmCreateResponseFromChallenge(HANDLE hSecurity, const char *szChallenge, char *szLogin = mir_t2a(login); char *szPassw = mir_t2a(psw); - size_t authLen = strlen(szLogin) + strlen(szPassw) + 5; + size_t authLen = mir_strlen(szLogin) + mir_strlen(szPassw) + 5; char *szAuth = (char*)alloca(authLen); int len = mir_snprintf(szAuth, authLen, "%s:%s", szLogin, szPassw); @@ -401,7 +401,7 @@ char* NtlmCreateResponseFromChallenge(HANDLE hSecurity, const char *szChallenge, return szOutputToken; ptrA szProvider(mir_t2a(hNtlm->szProvider)); - size_t resLen = strlen(szOutputToken) + strlen(szProvider) + 10; + size_t resLen = mir_strlen(szOutputToken) + mir_strlen(szProvider) + 10; char *result = (char*)mir_alloc(resLen); mir_snprintf(result, resLen, "%s %s", szProvider, szOutputToken); mir_free(szOutputToken); diff --git a/src/modules/netlib/netlibupnp.cpp b/src/modules/netlib/netlibupnp.cpp index 513aafaa55..c97a24050f 100644 --- a/src/modules/netlib/netlibupnp.cpp +++ b/src/modules/netlib/netlibupnp.cpp @@ -139,7 +139,7 @@ static bool txtParseParam(char* szData, char* presearch, cp = strstr(cp1, start); if (cp == NULL) return false; - cp += strlen(start); + cp += mir_strlen(start); while (*cp == ' ') ++cp; cp1 = strstr(cp, finish); @@ -163,7 +163,7 @@ void parseURL(char* szUrl, char* szHost, unsigned short* sPort, char* szPath) else phost += 3; ppath = strchr(phost, '/'); - if (ppath == NULL) ppath = phost + strlen(phost); + if (ppath == NULL) ppath = phost + mir_strlen(phost); pport = strchr(phost, ':'); if (pport == NULL) pport = ppath; @@ -452,7 +452,7 @@ retry: acksz += chunkBytes; peol2++; - memmove(data, peol2, strlen(peol2) + 1); + memmove(data, peol2, mir_strlen(peol2) + 1); sz -= peol2 - data; // Last chunk, all data received @@ -535,10 +535,10 @@ static bool getUPnPURLs(char* szUrl, size_t sizeUrl) rpth = rpth ? rpth + 2 : szCtlUrl; rpth = strchr(rpth, '/'); - if (rpth == NULL) rpth = szCtlUrl + strlen(szCtlUrl); + if (rpth == NULL) rpth = szCtlUrl + mir_strlen(szCtlUrl); } else { // relative URI rel_path - size_t ctlCLen = strlen(szCtlUrl); + size_t ctlCLen = mir_strlen(szCtlUrl); rpth = szCtlUrl + ctlCLen; if (ctlCLen != 0 && *(rpth - 1) != '/') strncpy(rpth++, "/", sizeof(szCtlUrl) - ctlCLen); -- cgit v1.2.3