From 64246e68515f9c73315a06f4f62738e45655f983 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 11 Oct 2013 15:48:26 +0000 Subject: dynamic memory allocation on buffer overrun. 99.95% of strings are still printed without any need of memory allocation git-svn-id: http://svn.miranda-ng.org/main/trunk@6440 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- include/m_string.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/m_string.h b/include/m_string.h index ae5e245916..fd7ab6a235 100644 --- a/include/m_string.h +++ b/include/m_string.h @@ -1975,12 +1975,13 @@ public: this->ReleaseBufferSetLength(nCurrentLength+nAppendLength); } - void FormatV(PCXSTR pszFormat, va_list args) + PCXSTR FormatV(PCXSTR pszFormat, va_list args) { int nLength = StringTraits::GetFormattedLength(pszFormat, args); PXSTR pszBuffer = this->GetBuffer(nLength); StringTraits::Format(pszBuffer, nLength+1, pszFormat, args); this->ReleaseBufferSetLength(nLength); + return GetString(); } // OLE BSTR support -- cgit v1.2.3