From 0a6272c6db52ea2fca975ebcb6304061db46297b Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Mon, 19 Jan 2009 00:45:00 +0100 Subject: [PATCH] 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 --- src/helpers.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helpers.cpp b/src/helpers.cpp index fa731fa5..7d48d387 100644 --- a/src/helpers.cpp +++ b/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::const_iterator b = s.begin(), e = s.end(); - for (std::basic_string::const_iterator it = b+pos; it != e && len < width; it++) + for (std::basic_string::const_iterator it = b+pos; it < e && len < width; it++) { # ifdef _UTF8 len += wcwidth(*it);