diff options
Diffstat (limited to 'xfa/fxfa/fm2js/cxfa_fmlexer.cpp')
-rw-r--r-- | xfa/fxfa/fm2js/cxfa_fmlexer.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/xfa/fxfa/fm2js/cxfa_fmlexer.cpp b/xfa/fxfa/fm2js/cxfa_fmlexer.cpp index 16e07b5b4f..1a43e837f4 100644 --- a/xfa/fxfa/fm2js/cxfa_fmlexer.cpp +++ b/xfa/fxfa/fm2js/cxfa_fmlexer.cpp @@ -372,12 +372,13 @@ void CXFA_FMLexer::AdvanceForNumber() { wchar_t* end = nullptr; if (m_cursor) wcstod(const_cast<wchar_t*>(m_cursor), &end); - if (end && FXSYS_iswalpha(*end)) { + if (!end || FXSYS_iswalpha(*end)) { RaiseError(); return; } - m_token->m_string = CFX_WideStringC(m_cursor, (end - m_cursor)); + m_token->m_string = + CFX_WideStringC(m_cursor, static_cast<FX_STRSIZE>(end - m_cursor)); m_cursor = end; } @@ -393,7 +394,8 @@ void CXFA_FMLexer::AdvanceForString() { ++m_cursor; // If the end of the input has been reached it was not escaped. if (m_cursor > m_end) { - m_token->m_string = CFX_WideStringC(start, (m_cursor - start)); + m_token->m_string = + CFX_WideStringC(start, static_cast<FX_STRSIZE>(m_cursor - start)); return; } // If the next character is not a " then the end of the string has been @@ -427,7 +429,8 @@ void CXFA_FMLexer::AdvanceForIdentifier() { } ++m_cursor; } - m_token->m_string = CFX_WideStringC(start, (m_cursor - start)); + m_token->m_string = + CFX_WideStringC(start, static_cast<FX_STRSIZE>(m_cursor - start)); m_token->m_type = TokenizeIdentifier(m_token->m_string); } |