diff options
author | Neil <nyamatongwe@gmail.com> | 2019-01-13 16:30:28 +1100 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2019-01-13 16:30:28 +1100 |
commit | 3a0bafea3e458fbe58d7de7bd242934784ceb02b (patch) | |
tree | eaff5d7475c85bcb6131362b1aeeca97976db859 /src/CharClassify.cxx | |
parent | c2aa7ed964464501fffbc3920967e7da4c8956cc (diff) | |
download | scintilla-mirror-3a0bafea3e458fbe58d7de7bd242934784ceb02b.tar.gz |
Replace the only use of a function from <cctype> with a Scintilla function.
Remove inclusion of <cctype> except in lexers as cctype functions often behave
poorly and may crash for out of bounds arguments.
Diffstat (limited to 'src/CharClassify.cxx')
-rw-r--r-- | src/CharClassify.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/CharClassify.cxx b/src/CharClassify.cxx index ba8433e62..5ae47a2ef 100644 --- a/src/CharClassify.cxx +++ b/src/CharClassify.cxx @@ -6,10 +6,11 @@ // The License.txt file describes the conditions under which this software may be distributed. #include <cstdlib> -#include <cctype> +#include <cassert> #include <stdexcept> +#include "CharacterSet.h" #include "CharClassify.h" using namespace Scintilla; @@ -25,7 +26,7 @@ void CharClassify::SetDefaultCharClasses(bool includeWordClass) { charClass[ch] = ccNewLine; else if (ch < 0x20 || ch == ' ') charClass[ch] = ccSpace; - else if (includeWordClass && (ch >= 0x80 || isalnum(ch) || ch == '_')) + else if (includeWordClass && (ch >= 0x80 || IsAlphaNumeric(ch) || ch == '_')) charClass[ch] = ccWord; else charClass[ch] = ccPunctuation; |