diff options
author | Tom Sepez <tsepez@chromium.org> | 2017-03-30 15:28:23 -0700 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-03-30 23:00:56 +0000 |
commit | 3efc06752c56b731e11d37310b981254c1ba461c (patch) | |
tree | b497a162a0f60ea3101d84d678662ab6ff8bf672 /core/fxcrt/fx_string.h | |
parent | bf9104d5825d9f62b59106d69edebb1b5bdd48da (diff) | |
download | pdfium-3efc06752c56b731e11d37310b981254c1ba461c.tar.xz |
vswprintf() part 2: retry when clearly out of space.chromium/3057
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 <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fxcrt/fx_string.h')
-rw-r--r-- | core/fxcrt/fx_string.h | 3 |
1 files changed, 3 insertions, 0 deletions
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<StringData> m_pData; friend class fxcrt_WideStringConcatInPlace_Test; |