From a6adac83c6aadbacf2a338d2e55148f7d3417762 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Thu, 2 Nov 2017 19:27:08 +0000 Subject: Remove some C-style const char* casts. Change-Id: I4785dd277b9da072ee3c55e2aaeb688bbf02852e Reviewed-on: https://pdfium-review.googlesource.com/17391 Reviewed-by: dsinclair Commit-Queue: Lei Zhang --- core/fpdfapi/parser/cpdf_syntax_parser.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'core/fpdfapi/parser/cpdf_syntax_parser.cpp') diff --git a/core/fpdfapi/parser/cpdf_syntax_parser.cpp b/core/fpdfapi/parser/cpdf_syntax_parser.cpp index f0ea5ac5b0..ddf420b34a 100644 --- a/core/fpdfapi/parser/cpdf_syntax_parser.cpp +++ b/core/fpdfapi/parser/cpdf_syntax_parser.cpp @@ -337,9 +337,10 @@ void CPDF_SyntaxParser::ToNextWord() { ByteString CPDF_SyntaxParser::GetNextWord(bool* bIsNumber) { const CPDF_ReadValidator::Session read_session(GetValidator().Get()); GetNextWordInternal(bIsNumber); - return GetValidator()->has_read_problems() - ? ByteString() - : ByteString((const char*)m_WordBuffer, m_WordSize); + ByteString ret; + if (!GetValidator()->has_read_problems()) + ret = ByteString(m_WordBuffer, m_WordSize); + return ret; } ByteString CPDF_SyntaxParser::PeekNextWord(bool* bIsNumber) { -- cgit v1.2.3