diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2015-09-23 19:39:21 +0100 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2015-09-23 19:39:21 +0100 |
| commit | 27571a77165f5cba2f7d0a7e335a4241dda91df7 (patch) | |
| tree | f9c565b35717170bed6d09c22c419b63939ac64a /src/string.cc | |
| parent | b5972cd6475e354c4432f2adf94fff73807daad3 (diff) | |
Refactor utf8::iterator to be on the safe side
utf8::iterator now knows the iterator valid range, and pass
it to utf8 functions.
Diffstat (limited to 'src/string.cc')
| -rw-r--r-- | src/string.cc | 6 |
1 files changed, 3 insertions, 3 deletions
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<StringView> wrap_lines(StringView text, CharCount max_width) throw runtime_error("Invalid max width"); using Utf8It = utf8::iterator<const char*>; - 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<StringView> lines; - Utf8It line_begin = text.begin(); + Utf8It line_begin{text.begin(), text}; Utf8It line_end = line_begin; while (word_begin != end) { |
