check if current iterator position is smaller than end, not equal
there's possibility that position at start will be greater than ending iterator, so the iteration must not be started
This commit is contained in:
1 parent
b93c04189e
commit
0a6272c6db
1 file changed
+1
-1
+1
-1
@@ -845,7 +845,7 @@ void Scroller(Window &w, const string &string, size_t width, size_t &pos)
|
||||
# endif
|
||||
len = 0;
|
||||
std::basic_string<my_char_t>::const_iterator b = s.begin(), e = s.end();
|
||||
for (std::basic_string<my_char_t>::const_iterator it = b+pos; it != e && len < width; it++)
|
||||
for (std::basic_string<my_char_t>::const_iterator it = b+pos; it < e && len < width; it++)
|
||||
{
|
||||
# ifdef _UTF8
|
||||
len += wcwidth(*it);
|
||||
|
||||
Reference in new issue
Block a user