From 54e95a99c031cc17b3cc985d9dd8c06a8b115d17 Mon Sep 17 00:00:00 2001 From: Victor Yacovlev Date: Mon, 21 Jan 2013 16:26:30 +0400 Subject: [PATCH] Fixed error message on accessing string at index < 1 --- src/shared/vm/vm.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/shared/vm/vm.hpp b/src/shared/vm/vm.hpp index 7ea8c1a9..51b6e305 100644 --- a/src/shared/vm/vm.hpp +++ b/src/shared/vm/vm.hpp @@ -1694,7 +1694,10 @@ void KumirVM::do_specialcall(uint16_t alg) Char ch = first.value().toChar(); s_error = Kumir::Core::getError(); 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("Индекс символа больше длины строки"); } else { -- GitLab