aboutsummaryrefslogtreecommitdiff
path: root/scene/gui/text_edit.cpp
diff options
context:
space:
mode:
authorfirefly24422015-09-16 15:51:19 -0500
committerfirefly24422015-10-12 09:45:44 -0500
commit692216b86ab97db91e7ff3903ffc9ac8e37433f6 (patch)
treedf9f3108dbf10d07ac8e669707e15bc99933c5e1 /scene/gui/text_edit.cpp
parentaad2bbdb6fb7c8217d7e75480b38e45f00cb3abd (diff)
downloadgodot-692216b86ab97db91e7ff3903ffc9ac8e37433f6.tar.gz
godot-692216b86ab97db91e7ff3903ffc9ac8e37433f6.tar.zst
godot-692216b86ab97db91e7ff3903ffc9ac8e37433f6.zip
ran cppcheck, fixed cases where array index is used before limits check
Diffstat (limited to 'scene/gui/text_edit.cpp')
-rw-r--r--scene/gui/text_edit.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index b5fdde30c..048901a87 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -709,7 +709,7 @@ void TextEdit::_notification(int p_what) {
if (in_region==-1 && !in_keyword && is_char && !prev_is_char) {
int to=j;
- while(_is_text_char(str[to]) && to<str.length())
+ while(to<str.length() && _is_text_char(str[to]))
to++;
uint32_t hash = String::hash(&str[j],to-j);