diff options
author | George Hazan <george.hazan@gmail.com> | 2015-06-04 22:12:13 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-06-04 22:12:13 +0000 |
commit | b7c74cd5b22618d544a3f4ae124985d4837e3a22 (patch) | |
tree | 468d9610a590685322ad2159a9bd2d9e2ba83f89 /plugins/HTTPServer | |
parent | 7de513f180c429859e246d1033d745b394e1fc28 (diff) |
new mir_snprintf templates without SIZEOF
git-svn-id: http://svn.miranda-ng.org/main/trunk@14002 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/HTTPServer')
-rw-r--r-- | plugins/HTTPServer/src/GuiElements.cpp | 16 | ||||
-rw-r--r-- | plugins/HTTPServer/src/main.cpp | 2 |
2 files changed, 9 insertions, 9 deletions
diff --git a/plugins/HTTPServer/src/GuiElements.cpp b/plugins/HTTPServer/src/GuiElements.cpp index ea28a2ba26..cf1157ad3b 100644 --- a/plugins/HTTPServer/src/GuiElements.cpp +++ b/plugins/HTTPServer/src/GuiElements.cpp @@ -201,7 +201,7 @@ unsigned long GetExternIP(const char *szURL, const char *szPattern) { string sCreateLink(const char * pszSrvPath) {
char szTemp[30];
string sLink = DBGetString(NULL, MODULE, "ExternalSrvName", szDefaultExternalSrvName);
- mir_snprintf(szTemp, SIZEOF(szTemp), "%d.%d.%d.%d", SplitIpAddress(dwLocalIpAddress));
+ mir_snprintf(szTemp, "%d.%d.%d.%d", SplitIpAddress(dwLocalIpAddress));
ReplaceAll(sLink, "%LocalIP%", szTemp);
if (sLink.find("%ExternalIP%") != sLink.npos) {
@@ -214,11 +214,11 @@ string sCreateLink(const char * pszSrvPath) { dwExternalIpAddressGenerated = GetTickCount();
}
- mir_snprintf(szTemp, SIZEOF(szTemp), "%d.%d.%d.%d", SplitIpAddress(dwExternalIpAddress));
+ mir_snprintf(szTemp, "%d.%d.%d.%d", SplitIpAddress(dwExternalIpAddress));
ReplaceAll(sLink, "%ExternalIP%", szTemp);
}
- mir_snprintf(szTemp, SIZEOF(szTemp), "%d", dwLocalPortUsed, szTemp);
+ mir_snprintf(szTemp, "%d", dwLocalPortUsed, szTemp);
ReplaceAll(sLink, "%Port%", szTemp);
string sSrvPath = pszSrvPath;
@@ -463,7 +463,7 @@ bool bShowShareNewFileDlg(HWND hwndOwner, STFileShareInfo * pstNewShare) { DWORD dwError = CommDlgExtendedError();
if (dwError) {
char szTemp[200];
- mir_snprintf(szTemp, SIZEOF(szTemp), "Failed to create File Open dialog the error returned was %d", dwError);
+ mir_snprintf(szTemp, "Failed to create File Open dialog the error returned was %d", dwError);
MessageBox(NULL, szTemp, MSG_BOX_TITEL, MB_OK);
}
return false;
@@ -560,7 +560,7 @@ void UpdateStatisticView(HWND hwndDlg, bool bRefressUsersOnly = false) { ListView_InsertItem(hShareList, &sItem);
- mir_snprintf(szTmp, SIZEOF(szTmp), "%d", pclCur->st.nMaxDownloads);
+ mir_snprintf(szTmp, "%d", pclCur->st.nMaxDownloads);
sItem.iSubItem = 1;
sItem.pszText = szTmp;
ListView_SetItem(hShareList, &sItem);
@@ -600,7 +600,7 @@ void UpdateStatisticView(HWND hwndDlg, bool bRefressUsersOnly = false) { ListView_SetItem(hUserList, &sItem);
if (pclCurUser->dwTotalSize) {
- mir_snprintf(szTmp, SIZEOF(szTmp), "%d %%", (pclCurUser->dwCurrentDL * 100) / pclCurUser->dwTotalSize);
+ mir_snprintf(szTmp, "%d %%", (pclCurUser->dwCurrentDL * 100) / pclCurUser->dwTotalSize);
} else {
mir_strcpy(szTmp, "? %%");
}
@@ -612,9 +612,9 @@ void UpdateStatisticView(HWND hwndDlg, bool bRefressUsersOnly = false) { if (dwSpeed > 10000) {
dwSpeed += 512; // make sure we round ot down correctly.
dwSpeed /= 1024;
- mir_snprintf(szTmp, SIZEOF(szTmp), "%d KB/Sec", dwSpeed);
+ mir_snprintf(szTmp, "%d KB/Sec", dwSpeed);
} else {
- mir_snprintf(szTmp, SIZEOF(szTmp), "%d B/Sec", dwSpeed);
+ mir_snprintf(szTmp, "%d B/Sec", dwSpeed);
}
sItem.iSubItem = 4;
sItem.pszText = szTmp;
diff --git a/plugins/HTTPServer/src/main.cpp b/plugins/HTTPServer/src/main.cpp index f63d31db5a..d89e8a4588 100644 --- a/plugins/HTTPServer/src/main.cpp +++ b/plugins/HTTPServer/src/main.cpp @@ -643,7 +643,7 @@ INT_PTR nToggelAcceptConnections(WPARAM wparam, LPARAM /*lparam*/) { hDirectBoundPort = (HANDLE) CallService(MS_NETLIB_BINDPORT, (WPARAM) hNetlibUser, (LPARAM) & nlb);
if (!hDirectBoundPort) {
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") ,
+ mir_snprintf(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;
|