Commit 54e95a99 authored by Victor Yacovlev's avatar Victor Yacovlev

Fixed error message on accessing string at index < 1

parent b60b2ae0
...@@ -1694,7 +1694,10 @@ void KumirVM::do_specialcall(uint16_t alg) ...@@ -1694,7 +1694,10 @@ void KumirVM::do_specialcall(uint16_t alg)
Char ch = first.value().toChar(); Char ch = first.value().toChar();
s_error = Kumir::Core::getError(); s_error = Kumir::Core::getError();
if (s_error.length()==0) { if (s_error.length()==0) {
if (index<1 || index>source.length()) { if (index<1) {
s_error = Kumir::Core::fromUtf8("Индекс символа меньше 1");
}
else if (index>source.length()) {
s_error = Kumir::Core::fromUtf8("Индекс символа больше длины строки"); s_error = Kumir::Core::fromUtf8("Индекс символа больше длины строки");
} }
else { else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment