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:
Andrzej Rybczak
2009-01-19 00:45:00 +01:00
parent b93c04189e
commit 0a6272c6db

View File

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