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/fxfa/parser/cxfa_measurement.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xfa/fxfa/parser/cxfa_measurement.cpp') diff --git a/xfa/fxfa/parser/cxfa_measurement.cpp b/xfa/fxfa/parser/cxfa_measurement.cpp index 9173223d3c..70420d7b5e 100644 --- a/xfa/fxfa/parser/cxfa_measurement.cpp +++ b/xfa/fxfa/parser/cxfa_measurement.cpp @@ -28,7 +28,7 @@ void CXFA_Measurement::Set(const CFX_WideStringC& wsMeasure) { } int32_t iUsedLen = 0; int32_t iOffset = (wsMeasure.GetAt(0) == L'=') ? 1 : 0; - float fValue = FXSYS_wcstof(wsMeasure.c_str() + iOffset, + float fValue = FXSYS_wcstof(wsMeasure.unterminated_c_str() + iOffset, wsMeasure.GetLength() - iOffset, &iUsedLen); XFA_UNIT eUnit = GetUnit(wsMeasure.Mid(iOffset + iUsedLen)); Set(fValue, eUnit); -- cgit v1.2.3