diff options
Diffstat (limited to 'src/gui/text')
-rw-r--r-- | src/gui/text/qtextmarkdownwriter.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/text/qtextmarkdownwriter.cpp b/src/gui/text/qtextmarkdownwriter.cpp index cda1f209ad..a5d8f4cc97 100644 --- a/src/gui/text/qtextmarkdownwriter.cpp +++ b/src/gui/text/qtextmarkdownwriter.cpp @@ -540,13 +540,13 @@ int QTextMarkdownWriter::writeBlock(const QTextBlock &block, bool wrap, bool ign } if (wrap && col + markers.length() * 2 + fragmentText.length() > ColumnLimit) { int i = 0; - int fragLen = fragmentText.length(); + const int fragLen = fragmentText.length(); bool breakingLine = false; while (i < fragLen) { if (col >= ColumnLimit) { m_stream << Newline << wrapIndentString; col = m_wrappedLineIndent; - while (fragmentText[i].isSpace()) + while (i < fragLen && fragmentText[i].isSpace()) ++i; } int j = i + ColumnLimit - col; |