summaryrefslogtreecommitdiff
path: root/src/modules/netlib
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2015-05-23 17:49:58 +0000
committerKirill Volinsky <mataes2007@gmail.com>2015-05-23 17:49:58 +0000
commit6fcfba2c46a456677b5825a899469ba4e8905448 (patch)
treeb4b6f6f9001b8609998a815ec1c7c92aa30b287e /src/modules/netlib
parent24bed968f1e96aa4598d8dbe3a6e8a34dded3dc2 (diff)
replace strncpy to mir_strncpy
git-svn-id: http://svn.miranda-ng.org/main/trunk@13785 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/netlib')
-rw-r--r--src/modules/netlib/netlibhttp.cpp2
-rw-r--r--src/modules/netlib/netlibsock.cpp2
-rw-r--r--src/modules/netlib/netlibupnp.cpp12
3 files changed, 8 insertions, 8 deletions
diff --git a/src/modules/netlib/netlibhttp.cpp b/src/modules/netlib/netlibhttp.cpp
index cd7a173f1a..a30a15f2bf 100644
--- a/src/modules/netlib/netlibhttp.cpp
+++ b/src/modules/netlib/netlibhttp.cpp
@@ -583,7 +583,7 @@ INT_PTR NetlibHttpSendRequest(WPARAM wParam, LPARAM lParam)
nlc->szNewUrl = (char*)mir_realloc(nlc->szNewUrl, rlen + mir_strlen(tmpUrl) * 3 + 1);
- strncpy(nlc->szNewUrl, pszFullUrl, rlen);
+ mir_strncpy(nlc->szNewUrl, pszFullUrl, rlen);
mir_strcpy(nlc->szNewUrl + rlen, tmpUrl);
pszFullUrl = nlc->szNewUrl;
pszUrl = NULL;
diff --git a/src/modules/netlib/netlibsock.cpp b/src/modules/netlib/netlibsock.cpp
index e53e73bd89..5aaea3613a 100644
--- a/src/modules/netlib/netlibsock.cpp
+++ b/src/modules/netlib/netlibsock.cpp
@@ -237,7 +237,7 @@ void NetlibGetConnectionInfo(NetlibConnection* nlc, NETLIBCONNINFO *connInfo)
connInfo->dwIpv4 = sin.si_family == AF_INET ? htonl(sin.Ipv4.sin_addr.s_addr) : 0;
char *szTmp = NetlibAddressToString(&sin);
- strncpy(connInfo->szIpPort, szTmp, sizeof(connInfo->szIpPort));
+ mir_strncpy(connInfo->szIpPort, szTmp, sizeof(connInfo->szIpPort));
connInfo->szIpPort[sizeof(connInfo->szIpPort) - 1] = 0;
mir_free(szTmp);
}
diff --git a/src/modules/netlib/netlibupnp.cpp b/src/modules/netlib/netlibupnp.cpp
index 2e3445126f..54fc04d640 100644
--- a/src/modules/netlib/netlibupnp.cpp
+++ b/src/modules/netlib/netlibupnp.cpp
@@ -147,7 +147,7 @@ static bool txtParseParam(char* szData, char* presearch,
while (*(cp1-1) == ' ' && cp1 > cp) --cp1;
len = min((size_t)(cp1 - cp), size-1);
- strncpy(param, cp, len);
+ mir_strncpy(param, cp, len);
param[len] = 0;
return true;
@@ -171,7 +171,7 @@ void parseURL(char* szUrl, char* szHost, unsigned short* sPort, char* szPath)
if (szHost != NULL) {
sz = pport - phost + 1;
if (sz > 256) sz = 256;
- strncpy(szHost, phost, sz);
+ mir_strncpy(szHost, phost, sz);
szHost[sz - 1] = 0;
}
@@ -185,7 +185,7 @@ void parseURL(char* szUrl, char* szHost, unsigned short* sPort, char* szPath)
}
if (szPath != NULL) {
- strncpy(szPath, ppath, 256);
+ mir_strncpy(szPath, ppath, 256);
szPath[255] = 0;
}
}
@@ -514,7 +514,7 @@ static bool getUPnPURLs(char* szUrl, size_t sizeUrl)
size_t ctlLen;
txtParseParam(szData, NULL, "<URLBase>", "</URLBase>", szTemp, sizeof(szTemp));
- strncpy(szCtlUrl, szTemp[0] ? szTemp : szUrl, sizeof(szCtlUrl));
+ mir_strncpy(szCtlUrl, szTemp[0] ? szTemp : szUrl, sizeof(szCtlUrl));
szCtlUrl[sizeof(szCtlUrl) - 1] = 0;
mir_snprintf(szTemp, SIZEOF(szTemp), search_device, szDev);
@@ -541,11 +541,11 @@ static bool getUPnPURLs(char* szUrl, size_t sizeUrl)
size_t ctlCLen = mir_strlen(szCtlUrl);
rpth = szCtlUrl + ctlCLen;
if (ctlCLen != 0 && *(rpth - 1) != '/')
- strncpy(rpth++, "/", sizeof(szCtlUrl) - ctlCLen);
+ mir_strncpy(rpth++, "/", sizeof(szCtlUrl) - ctlCLen);
}
ctlLen = sizeof(szCtlUrl) - (rpth - szCtlUrl);
- strncpy(rpth, szUrl, ctlLen);
+ mir_strncpy(rpth, szUrl, ctlLen);
szCtlUrl[sizeof(szCtlUrl) - 1] = 0;
}
else {