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 --- fxjs/fxjs_v8.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fxjs/fxjs_v8.cpp') diff --git a/fxjs/fxjs_v8.cpp b/fxjs/fxjs_v8.cpp index 970e4f144d..d3d2010b30 100644 --- a/fxjs/fxjs_v8.cpp +++ b/fxjs/fxjs_v8.cpp @@ -648,7 +648,7 @@ v8::Local CFXJS_Engine::NewBoolean(bool b) { v8::Local CFXJS_Engine::NewString(const CFX_ByteStringC& str) { v8::Isolate* pIsolate = m_isolate ? m_isolate : v8::Isolate::GetCurrent(); - return v8::String::NewFromUtf8(pIsolate, str.c_str(), + return v8::String::NewFromUtf8(pIsolate, str.unterminated_c_str(), v8::NewStringType::kNormal, str.GetLength()) .ToLocalChecked(); } -- cgit v1.2.3