From 27571a77165f5cba2f7d0a7e335a4241dda91df7 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 23 Sep 2015 19:39:21 +0100 Subject: Refactor utf8::iterator to be on the safe side utf8::iterator now knows the iterator valid range, and pass it to utf8 functions. --- src/string.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/string.cc') diff --git a/src/string.cc b/src/string.cc index b6d0f3de..e0f3525d 100644 --- a/src/string.cc +++ b/src/string.cc @@ -225,12 +225,12 @@ Vector wrap_lines(StringView text, CharCount max_width) throw runtime_error("Invalid max width"); using Utf8It = utf8::iterator; - Utf8It word_begin{text.begin()}; + Utf8It word_begin{text.begin(), text}; Utf8It word_end{word_begin}; - Utf8It end{text.end()}; + Utf8It end{text.end(), text}; CharCount col = 0; Vector lines; - Utf8It line_begin = text.begin(); + Utf8It line_begin{text.begin(), text}; Utf8It line_end = line_begin; while (word_begin != end) { -- cgit v1.2.3