From 69da36c5f841e8c6e5ded6c704d9ef58c57d532a Mon Sep 17 00:00:00 2001 From: Ryan Harrison Date: Fri, 9 Mar 2018 17:46:50 +0000 Subject: Explicitly mark helper methods that only operate on ASCII ranges A number of our character helper methods take in wide character types, but only do tests/operations on the ASCII range of characters. As a very quick first pass I am renaming all of the foot-gun methods to explictly call out this behaviour, while I do a bigger cleanup/refactor. BUG=pdfium:1035 Change-Id: Ia035dfa1cb6812fa6d45155c4565475032c4c165 Reviewed-on: https://pdfium-review.googlesource.com/28330 Commit-Queue: Ryan Harrison Commit-Queue: dsinclair Reviewed-by: Henrique Nakashima Reviewed-by: dsinclair --- xfa/fxfa/fm2js/cxfa_fmlexer.cpp | 2 +- xfa/fxfa/parser/cxfa_localevalue.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'xfa/fxfa') diff --git a/xfa/fxfa/fm2js/cxfa_fmlexer.cpp b/xfa/fxfa/fm2js/cxfa_fmlexer.cpp index 3559fb7aeb..4dc8788a1a 100644 --- a/xfa/fxfa/fm2js/cxfa_fmlexer.cpp +++ b/xfa/fxfa/fm2js/cxfa_fmlexer.cpp @@ -306,7 +306,7 @@ CXFA_FMToken CXFA_FMLexer::AdvanceForNumber() { wchar_t* end = nullptr; if (m_cursor) wcstod(const_cast(m_cursor), &end); - if (!end || FXSYS_iswalpha(*end)) { + if (!end || FXSYS_iswASCIIalpha(*end)) { RaiseError(); return CXFA_FMToken(); } diff --git a/xfa/fxfa/parser/cxfa_localevalue.cpp b/xfa/fxfa/parser/cxfa_localevalue.cpp index 8ef67e5183..57d6fbb4b6 100644 --- a/xfa/fxfa/parser/cxfa_localevalue.cpp +++ b/xfa/fxfa/parser/cxfa_localevalue.cpp @@ -202,7 +202,7 @@ double CXFA_LocaleValue::GetDoubleNum() const { bool bExpSign = false; const wchar_t* str = m_wsValue.c_str(); int len = m_wsValue.GetLength(); - while (FXSYS_iswspace(str[cc]) && cc < len) + while (FXSYS_iswASCIIspace(str[cc]) && cc < len) cc++; if (cc >= len) -- cgit v1.2.3