#include "support/debug.h"
#include "support/gettext.h"
#include "support/lstrings.h"
#include "support/debug.h"
#include "support/gettext.h"
#include "support/lstrings.h"
ParagraphList::const_iterator end = par.end();
ParagraphList::const_iterator it = beg;
for (; it != end; ++it) {
ParagraphList::const_iterator end = par.end();
ParagraphList::const_iterator it = beg;
for (; it != end; ++it) {
writePlaintextParagraph(buf, *it, os, runparams, ref_printed);
writePlaintextParagraph(buf, *it, os, runparams, ref_printed);
os << docstring(depth * 2, ' ');
currlinelen += depth * 2;
os << docstring(depth * 2, ' ');
currlinelen += depth * 2;
- char_type c = par.getUChar(buf.params(), i);
+ if (os.str().size() > max_length)
+ break;
+
+ char_type c = par.getUChar(buf.params(), runparams, i);