summaryrefslogtreecommitdiff
path: root/plugins/HTTPServer
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 /plugins/HTTPServer
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 'plugins/HTTPServer')
-rw-r--r--plugins/HTTPServer/src/GuiElements.cpp8
-rw-r--r--plugins/HTTPServer/src/HttpUser.cpp4
-rw-r--r--plugins/HTTPServer/src/IndexHTML.cpp14
-rw-r--r--plugins/HTTPServer/src/IndexXML.cpp16
4 files changed, 21 insertions, 21 deletions
diff --git a/plugins/HTTPServer/src/GuiElements.cpp b/plugins/HTTPServer/src/GuiElements.cpp
index b2b67837ee..74775c5f2f 100644
--- a/plugins/HTTPServer/src/GuiElements.cpp
+++ b/plugins/HTTPServer/src/GuiElements.cpp
@@ -493,7 +493,7 @@ bool bShowShareNewFileDlg(HWND hwndOwner, STFileShareInfo * pstNewShare) {
*(end - (start - (pstNewShare->pszSrvPath+1)) ) = '\0';
int realPathLen = szRealDirectoryEnd - pstNewShare->pszRealPath;
- strncpy(szRealDirectoryEnd, pstNewShare->pszSrvPath+1,
+ mir_strncpy(szRealDirectoryEnd, pstNewShare->pszSrvPath+1,
pstNewShare->dwMaxRealPath - realPathLen - 1);
pstNewShare->pszRealPath[pstNewShare->dwMaxRealPath] = '\0';
@@ -792,7 +792,7 @@ static INT_PTR CALLBACK DlgProcStatsticView(HWND hwndDlg, UINT msg, WPARAM wPara
szServPath[0] = '/';
char* fileName = strrchr(szDropedFile, '\\');
if (fileName)
- strncpy(&szServPath[1], fileName+1, MAX_PATH-2);
+ mir_strncpy(&szServPath[1], fileName+1, MAX_PATH-2);
if (CallService(MS_HTTP_ADD_CHANGE_REMOVE, 0, (LPARAM)&stNewShare)) {
MessageBox(NULL, TranslateT("Failed to share new file"), MSG_BOX_TITEL, MB_OK);
@@ -1429,8 +1429,8 @@ void ShowPopupWindow(const char * pszName, const char * pszText, COLORREF ColorB
POPUPDATAT *pclData = new POPUPDATAT;
memset(pclData, 0, sizeof(POPUPDATAT));
pclData->lchIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_SHARE_NEW_FILE));
- strncpy(pclData->lpzContactName, pszName, sizeof(pclData->lpzContactName) - 1); // -1 so that there aways will be a null termination !!
- strncpy(pclData->lpzText, pszText, sizeof(pclData->lpzText) - 1);
+ mir_strncpy(pclData->lpzContactName, pszName, sizeof(pclData->lpzContactName) - 1); // -1 so that there aways will be a null termination !!
+ mir_strncpy(pclData->lpzText, pszText, sizeof(pclData->lpzText) - 1);
pclData->colorBack = ColorBack;
//ppd.colorText = colorText;
pclData->PluginWindowProc = PopupWindowProc;
diff --git a/plugins/HTTPServer/src/HttpUser.cpp b/plugins/HTTPServer/src/HttpUser.cpp
index e1398215bc..4c5604ea07 100644
--- a/plugins/HTTPServer/src/HttpUser.cpp
+++ b/plugins/HTTPServer/src/HttpUser.cpp
@@ -396,8 +396,8 @@ bool CLHttpUser::bProcessGetRequest(char * pszRequest, bool bIsGetCommand) {
char* pszRealPath = pclCur->st.pszRealPath;
if (pclCur->bIsDirectory()) {
- strncpy(szRealPath, pclCur->st.pszRealPath, MAX_PATH);
- strncpy(szSrvPath, pclCur->st.pszSrvPath, MAX_PATH);
+ mir_strncpy(szRealPath, pclCur->st.pszRealPath, MAX_PATH);
+ mir_strncpy(szSrvPath, pclCur->st.pszSrvPath, MAX_PATH);
pszRealPath = szRealPath;
pszSrvPath = szSrvPath;
diff --git a/plugins/HTTPServer/src/IndexHTML.cpp b/plugins/HTTPServer/src/IndexHTML.cpp
index a2ae11602f..3a0dc74c16 100644
--- a/plugins/HTTPServer/src/IndexHTML.cpp
+++ b/plugins/HTTPServer/src/IndexHTML.cpp
@@ -62,7 +62,7 @@ bool LoadIndexHTMLTemplate() {
char szDestBuf[10000];
char* pszDestBuf = szDestBuf;
- strncpy(pszBuf, szPluginPath, SIZEOF(szBuf)-1);
+ mir_strncpy(pszBuf, szPluginPath, SIZEOF(szBuf)-1);
mir_strncat(pszBuf, szIndexHTMLTemplateFile, SIZEOF(szBuf) - mir_strlen(szBuf));
HANDLE hFile = CreateFile(pszBuf, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE,
@@ -139,7 +139,7 @@ bool LoadIndexHTMLTemplate() {
do {
if (*pszBuf == ',') {
*pszBuf = ':';
- strncpy(pszDestBuf, pszParameterBegin, MAX_PARAM_LENGTH);
+ mir_strncpy(pszDestBuf, pszParameterBegin, MAX_PARAM_LENGTH);
pszDestBuf += MAX_PARAM_LENGTH;
pszParameterBegin = pszBuf + 1;
@@ -152,7 +152,7 @@ bool LoadIndexHTMLTemplate() {
break;
*pszBuf = ':';
- strncpy(pszDestBuf, pszParameterBegin, MAX_PARAM_LENGTH);
+ mir_strncpy(pszDestBuf, pszParameterBegin, MAX_PARAM_LENGTH);
pszDestBuf += MAX_PARAM_LENGTH;
*pcParamCount = iParamCount;
@@ -283,7 +283,7 @@ bool bCreateIndexHTML(const char * pszRealPath, const char * pszIndexPath,
// check if directory exists
char szMask[MAX_PATH];
- strncpy(szMask, pszRealPath, MAX_PATH- 1);
+ mir_strncpy(szMask, pszRealPath, MAX_PATH- 1);
mir_strncat(szMask, "*", SIZEOF(szMask) - mir_strlen(szMask));
WIN32_FIND_DATAA fdFindFileData;
@@ -319,14 +319,14 @@ bool bCreateIndexHTML(const char * pszRealPath, const char * pszIndexPath,
bool bEvenOdd = 0;
bool bKnownFileType = false;
- strncpy(szBuffer, pszSrvPath, SIZEOF(szBuffer)-1);
+ mir_strncpy(szBuffer, pszSrvPath, SIZEOF(szBuffer)-1);
char* pszTemp = strrchr(szBuffer, '/');
if (pszTemp)
*pszTemp = '\0';
pszTemp = strrchr(szBuffer, '/');
if (pszTemp)
- strncpy(szName, pszTemp + 1, SIZEOF(szName)-1);
+ mir_strncpy(szName, pszTemp + 1, SIZEOF(szName)-1);
if (szName[0] == '\0')
mir_strcpy(szName, "my Miranda Webserver");
@@ -470,7 +470,7 @@ bool bCreateIndexHTML(const char * pszRealPath, const char * pszIndexPath,
} else {
for (byte i = 0; i < iParamCount; i++) {
char szParam[MAX_PARAM_LENGTH+1];
- strncpy(szParam, pszParam, MAX_PARAM_LENGTH);
+ mir_strncpy(szParam, pszParam, MAX_PARAM_LENGTH);
szParam[MAX_PARAM_LENGTH] = '\0';
char* pszTmp = strchr(szParam, ':');
if (pszTmp)
diff --git a/plugins/HTTPServer/src/IndexXML.cpp b/plugins/HTTPServer/src/IndexXML.cpp
index 7de9c2cc8b..d24f76a03e 100644
--- a/plugins/HTTPServer/src/IndexXML.cpp
+++ b/plugins/HTTPServer/src/IndexXML.cpp
@@ -32,7 +32,7 @@ static void ReplaceSign(char* pszSrc, int MaxLength, const char pszReplace,
char* pszSign = strchr(pszSrc, pszReplace);
if (pszSign) {
- strncpy(szBuffer, pszSrc, SIZEOF(szBuffer)-1);
+ mir_strncpy(szBuffer, pszSrc, SIZEOF(szBuffer)-1);
do {
mir_strcpy(szBuffer + (pszSign - pszSrc), pszNew);
@@ -41,7 +41,7 @@ static void ReplaceSign(char* pszSrc, int MaxLength, const char pszReplace,
} while (pszSign = strchr(pszSrc, pszReplace));
- strncpy(pszSrc, szBuffer, MaxLength);
+ mir_strncpy(pszSrc, szBuffer, MaxLength);
pszSrc[MaxLength-1] = '\0';
}
@@ -64,7 +64,7 @@ static void ReplaceSign(char* pszSrc, int MaxLength, const char pszReplace,
bool bCreateIndexXML(const char * pszRealPath, const char * pszIndexPath,
const char * pszSrvPath, DWORD dwRemoteIP) {
char szMask[MAX_PATH+1];
- strncpy(szMask, pszRealPath, MAX_PATH);
+ mir_strncpy(szMask, pszRealPath, MAX_PATH);
mir_strncat(szMask, "*", SIZEOF(szMask) - mir_strlen(szMask));
WIN32_FIND_DATAA fdFindFileData;
@@ -89,20 +89,20 @@ bool bCreateIndexXML(const char * pszRealPath, const char * pszIndexPath,
DWORD dwBytesWritten = 0;
// Generate Dirname
- strncpy(szBuffer, pszSrvPath, BUFFER_SIZE);
+ mir_strncpy(szBuffer, pszSrvPath, BUFFER_SIZE);
char* pszTemp = strrchr(szBuffer, '/');
if (pszTemp)
*pszTemp = '\0';
pszTemp = strrchr(szBuffer, '/');
if (pszTemp)
- strncpy(szFileName, pszTemp + 1, MAX_PATH);
+ mir_strncpy(szFileName, pszTemp + 1, MAX_PATH);
// Write Header
WriteFile(hFile, szXmlHeader1, sizeof(szXmlHeader1) - 1, &dwBytesWritten, NULL);
// check if a index.xsl exists in the same directory otherwise use the global
- strncpy(szMask, pszRealPath, MAX_PATH);
+ mir_strncpy(szMask, pszRealPath, MAX_PATH);
mir_strncat(szMask, "index.xsl", SIZEOF(szMask) - mir_strlen(szMask));
HANDLE hFileExists = CreateFile(szMask, GENERIC_READ,
@@ -110,10 +110,10 @@ bool bCreateIndexXML(const char * pszRealPath, const char * pszIndexPath,
FILE_ATTRIBUTE_NORMAL, NULL);
if (hFileExists == INVALID_HANDLE_VALUE) {
- strncpy(szBuffer, "/index.xsl", BUFFER_SIZE);
+ mir_strncpy(szBuffer, "/index.xsl", BUFFER_SIZE);
} else {
CloseHandle(hFileExists);
- strncpy(szBuffer, "index.xsl", BUFFER_SIZE);
+ mir_strncpy(szBuffer, "index.xsl", BUFFER_SIZE);
}
WriteFile(hFile, szBuffer, (DWORD)mir_strlen(szBuffer), &dwBytesWritten, NULL);