summaryrefslogtreecommitdiff
path: root/plugins/HTTPServer/src
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/HTTPServer/src')
-rw-r--r--plugins/HTTPServer/src/IndexXML.cpp22
-rw-r--r--plugins/HTTPServer/src/main.cpp6
2 files changed, 14 insertions, 14 deletions
diff --git a/plugins/HTTPServer/src/IndexXML.cpp b/plugins/HTTPServer/src/IndexXML.cpp
index 0297a1f038..f05efe472a 100644
--- a/plugins/HTTPServer/src/IndexXML.cpp
+++ b/plugins/HTTPServer/src/IndexXML.cpp
@@ -122,7 +122,7 @@ bool bCreateIndexXML(const char * pszRealPath, const char * pszIndexPath,
// Write dirname
ReplaceSign(szFileName, MAX_PATH, '&', "&");
- pszBuffer += _snprintf(pszBuffer, BUFFER_SIZE - (pszBuffer - szBuffer),
+ pszBuffer += mir_snprintf(pszBuffer, BUFFER_SIZE - (pszBuffer - szBuffer),
" <dirname>%s</dirname>\r\n", szFileName);
WriteFile(hFile, szBuffer, pszBuffer - szBuffer, &dwBytesWritten, NULL);
@@ -137,7 +137,7 @@ bool bCreateIndexXML(const char * pszRealPath, const char * pszIndexPath,
ReplaceSign(szFileName, MAX_PATH, '&', "&amp;");
if (fdFindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
- pszBuffer += _snprintf(pszBuffer, BUFFER_SIZE - (pszBuffer - szBuffer),
+ pszBuffer += mir_snprintf(pszBuffer, BUFFER_SIZE - (pszBuffer - szBuffer),
" <item name=\"%s\" isdir=\"true\"/>\r\n", szFileName);
} else {
pszExt = strrchr(szFileName, '.');
@@ -147,24 +147,24 @@ bool bCreateIndexXML(const char * pszRealPath, const char * pszIndexPath,
pszExt++;
}
- pszBuffer += _snprintf(pszBuffer, BUFFER_SIZE - (pszBuffer - szBuffer),
+ pszBuffer += mir_snprintf(pszBuffer, BUFFER_SIZE - (pszBuffer - szBuffer),
" <item name=\"%s\" ext=\"%s\" size=\"%i\" ",
szFileName, (pszExt == NULL) ? "" : pszExt, fdFindFileData.nFileSizeLow);
SYSTEMTIME systemTime;
FileTimeToSystemTime(&fdFindFileData.ftCreationTime, &systemTime);
- pszBuffer += _snprintf(pszBuffer, BUFFER_SIZE - (pszBuffer - szBuffer),
+ pszBuffer += mir_snprintf(pszBuffer, BUFFER_SIZE - (pszBuffer - szBuffer),
"created=\"%i/%02i/%02i %i:%02i:%02i\" ",
systemTime.wYear, systemTime.wMonth, systemTime.wDay, systemTime.wHour,
systemTime.wMinute, systemTime.wSecond);
FileTimeToSystemTime(&fdFindFileData.ftLastWriteTime, &systemTime);
- pszBuffer += _snprintf(pszBuffer, BUFFER_SIZE - (pszBuffer - szBuffer),
+ pszBuffer += mir_snprintf(pszBuffer, BUFFER_SIZE - (pszBuffer - szBuffer),
"modified=\"%i/%02i/%02i %i:%02i:%02i\" ",
systemTime.wYear, systemTime.wMonth, systemTime.wDay, systemTime.wHour,
systemTime.wMinute, systemTime.wSecond);
- pszBuffer += _snprintf(pszBuffer, BUFFER_SIZE - (pszBuffer - szBuffer),
+ pszBuffer += mir_snprintf(pszBuffer, BUFFER_SIZE - (pszBuffer - szBuffer),
"/>\r\n");
}
@@ -191,7 +191,7 @@ bool bCreateIndexXML(const char * pszRealPath, const char * pszIndexPath,
if (pclCur->bIsDirectory()) {
szFileName[strlen(szFileName)-1] = '\0';
if (!strchr(szFileName, '/')) { // only one level deeper
- pszBuffer += _snprintf(pszBuffer, BUFFER_SIZE - (pszBuffer - szBuffer),
+ pszBuffer += mir_snprintf(pszBuffer, BUFFER_SIZE - (pszBuffer - szBuffer),
" <item name=\"%s\" isdir=\"true\"/>\r\n", szFileName);
if (!WriteFile(hFile, szBuffer, pszBuffer - szBuffer, &dwBytesWritten, NULL))
@@ -219,24 +219,24 @@ bool bCreateIndexXML(const char * pszRealPath, const char * pszIndexPath,
CloseHandle(hFileS);
}
- pszBuffer += _snprintf(pszBuffer, BUFFER_SIZE - (pszBuffer - szBuffer),
+ pszBuffer += mir_snprintf(pszBuffer, BUFFER_SIZE - (pszBuffer - szBuffer),
" <item name=\"%s\" ext=\"%s\" size=\"%i\" ",
szFileName, (pszExt == NULL) ? "" : pszExt, dwFileSize);
SYSTEMTIME systemTime;
FileTimeToSystemTime(&ftFileCreateTime, &systemTime);
- pszBuffer += _snprintf(pszBuffer, BUFFER_SIZE - (pszBuffer - szBuffer),
+ pszBuffer += mir_snprintf(pszBuffer, BUFFER_SIZE - (pszBuffer - szBuffer),
"created=\"%i/%02i/%02i %i:%02i:%02i\" ",
systemTime.wYear, systemTime.wMonth, systemTime.wDay, systemTime.wHour,
systemTime.wMinute, systemTime.wSecond);
FileTimeToSystemTime(&ftFileModifyTime, &systemTime);
- pszBuffer += _snprintf(pszBuffer, BUFFER_SIZE - (pszBuffer - szBuffer),
+ pszBuffer += mir_snprintf(pszBuffer, BUFFER_SIZE - (pszBuffer - szBuffer),
"modified=\"%i/%02i/%02i %i:%02i:%02i\" ",
systemTime.wYear, systemTime.wMonth, systemTime.wDay, systemTime.wHour,
systemTime.wMinute, systemTime.wSecond);
- pszBuffer += _snprintf(pszBuffer, BUFFER_SIZE - (pszBuffer - szBuffer),
+ pszBuffer += mir_snprintf(pszBuffer, BUFFER_SIZE - (pszBuffer - szBuffer),
"/>\r\n");
if (!WriteFile(hFile, szBuffer, pszBuffer - szBuffer, &dwBytesWritten, NULL))
diff --git a/plugins/HTTPServer/src/main.cpp b/plugins/HTTPServer/src/main.cpp
index b59587737e..f71fe47ac0 100644
--- a/plugins/HTTPServer/src/main.cpp
+++ b/plugins/HTTPServer/src/main.cpp
@@ -345,7 +345,7 @@ bool bWriteConfigurationFile() {
} else {
CLFileShareNode * pclCur = pclFirstNode;
while (pclCur) {
- DWORD dwBytesToWrite = _snprintf(szBuf, sizeof(szBuf), szXmlData ,
+ DWORD dwBytesToWrite = mir_snprintf(szBuf, sizeof(szBuf), szXmlData ,
pclCur->st.pszSrvPath,
pclCur->pszOrigRealPath,
pclCur->st.nMaxDownloads,
@@ -646,8 +646,8 @@ INT_PTR nToggelAcceptConnections(WPARAM wparam, LPARAM /*lparam*/) {
}
hDirectBoundPort = (HANDLE) CallService(MS_NETLIB_BINDPORT, (WPARAM) hNetlibUser, (LPARAM) & nlb);
if (!hDirectBoundPort) {
- char szTemp[200];
- _snprintf(szTemp, sizeof(szTemp), TranslateT("Failed to bind to port %s\r\nThis is most likely because another program or service is using this port") ,
+ TCHAR szTemp[200];
+ mir_snprintf(szTemp, SIZEOF(szTemp), TranslateT("Failed to bind to port %s\r\nThis is most likely because another program or service is using this port") ,
nlb.wPort == 80 ? "80" : nus.szIncomingPorts);
MessageBox(NULL, szTemp, MSG_BOX_TITEL, MB_OK);
return 1001;