From 3efc06752c56b731e11d37310b981254c1ba461c Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Thu, 30 Mar 2017 15:28:23 -0700 Subject: vswprintf() part 2: retry when clearly out of space. Use vendor guidance if possible. Otherwise, avoid allocating N^2 storage for N wide chars. Update tests to account for strings removed from helper. Change-Id: I38bbaf936656fb43ec1ae33652da4cabde00247a Reviewed-on: https://pdfium-review.googlesource.com/3433 Commit-Queue: Tom Sepez Reviewed-by: Lei Zhang --- core/fxcrt/fx_string.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'core/fxcrt/fx_string.h') diff --git a/core/fxcrt/fx_string.h b/core/fxcrt/fx_string.h index 494633e41d..f276853197 100644 --- a/core/fxcrt/fx_string.h +++ b/core/fxcrt/fx_string.h @@ -357,6 +357,9 @@ class CFX_WideString { void AssignCopy(const wchar_t* pSrcData, FX_STRSIZE nSrcLen); void Concat(const wchar_t* lpszSrcData, FX_STRSIZE nSrcLen); + // Returns true unless we ran out of space. + bool TryVSWPrintf(FX_STRSIZE size, const wchar_t* format, va_list argList); + CFX_RetainPtr m_pData; friend class fxcrt_WideStringConcatInPlace_Test; -- cgit v1.2.3