summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mir_core/commonheaders.h3
-rw-r--r--src/mir_core/mstring.cpp1
-rw-r--r--src/mir_core/protos.cpp10
3 files changed, 5 insertions, 9 deletions
diff --git a/src/mir_core/commonheaders.h b/src/mir_core/commonheaders.h
index 216eaf23f6..bf8e5444ff 100644
--- a/src/mir_core/commonheaders.h
+++ b/src/mir_core/commonheaders.h
@@ -35,8 +35,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <commctrl.h>
#include <vssym32.h>
-#include <string>
-
#include <malloc.h>
#include <stdio.h>
#include <time.h>
@@ -56,6 +54,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <m_db_int.h>
#include <newpluginapi.h>
#include <m_langpack.h>
+#include <m_string.h>
#include "miranda.h"
diff --git a/src/mir_core/mstring.cpp b/src/mir_core/mstring.cpp
index 8d896f89d1..e0776da599 100644
--- a/src/mir_core/mstring.cpp
+++ b/src/mir_core/mstring.cpp
@@ -22,7 +22,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "commonheaders.h"
-#include "m_string.h"
/////////////////////////////////////////////////////////////////////////////////////////
// CMBaseString
diff --git a/src/mir_core/protos.cpp b/src/mir_core/protos.cpp
index 95648a4333..d4a02757bb 100644
--- a/src/mir_core/protos.cpp
+++ b/src/mir_core/protos.cpp
@@ -48,17 +48,15 @@ void UninitProtocols()
MIR_CORE_DLL(void) ProtoLogA(struct PROTO_INTERFACE *pThis, LPCSTR szFormat, va_list args)
{
char buf[4096];
- _vsnprintf(buf, sizeof(buf), szFormat, args);
- buf[sizeof(buf)-1] = 0;
- CallService(MS_NETLIB_LOG, (WPARAM)pThis->m_hNetlibUser, (LPARAM)buf);
+ int res = _vsnprintf_s(buf, sizeof(buf), szFormat, args);
+ CallService(MS_NETLIB_LOG, (WPARAM)pThis->m_hNetlibUser, (LPARAM)((res != -1) ? buf : CMStringA().FormatV(szFormat, args)));
}
MIR_CORE_DLL(void) ProtoLogW(struct PROTO_INTERFACE *pThis, LPCWSTR wszFormat, va_list args)
{
WCHAR buf[4096];
- _vsnwprintf(buf, SIZEOF(buf), wszFormat, args);
- buf[SIZEOF(buf)-1] = 0;
- CallService(MS_NETLIB_LOGW, (WPARAM)pThis->m_hNetlibUser, (LPARAM)buf);
+ int res = _vsnwprintf_s(buf, SIZEOF(buf), wszFormat, args);
+ CallService(MS_NETLIB_LOGW, (WPARAM)pThis->m_hNetlibUser, (LPARAM)((res != -1) ? buf : CMStringW().FormatV(wszFormat, args)));
}
/////////////////////////////////////////////////////////////////////////////////////////