From 33b42e4ab56d56ff02cd08a47c5f590875d886bf Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Wed, 19 Jul 2017 13:19:12 -0700 Subject: Rename StringCs c_str() to unterminated_c_str(). Since there is no guarantee of termination if the StringC was extracted from a snippet of another string. Make it more obvious that things like strlen(str.unterminated_c_str()) might be a bad idea. Change-Id: I7832248ed89ebbddf5c0bcd402aac7d40ec2adc2 Reviewed-on: https://pdfium-review.googlesource.com/8170 Commit-Queue: Tom Sepez Reviewed-by: dsinclair Reviewed-by: Henrique Nakashima --- xfa/fwl/theme/cfwl_widgettp.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'xfa/fwl') diff --git a/xfa/fwl/theme/cfwl_widgettp.cpp b/xfa/fwl/theme/cfwl_widgettp.cpp index 90a144fcc1..e863a0e0d3 100644 --- a/xfa/fwl/theme/cfwl_widgettp.cpp +++ b/xfa/fwl/theme/cfwl_widgettp.cpp @@ -291,8 +291,9 @@ bool CFWL_FontData::LoadFont(const CFX_WideStringC& wsFontFamily, m_pFontMgr = CFGAS_FontMgr::Create(m_pFontSource.get()); #endif } - m_pFont = CFGAS_GEFont::LoadFont(wsFontFamily.c_str(), dwFontStyles, - dwCodePage, m_pFontMgr.get()); + // TODO(tsepez): check usage of c_str() below. + m_pFont = CFGAS_GEFont::LoadFont(wsFontFamily.unterminated_c_str(), + dwFontStyles, dwCodePage, m_pFontMgr.get()); return !!m_pFont; } -- cgit v1.2.3