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
master
Andrzej Rybczak 17 years ago
parent b93c04189e
commit 0a6272c6db
  1. 2
      src/helpers.cpp

@ -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);

Loading…
Cancel
Save