summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/format.cc
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/format.cc')
-rw-r--r--crawl-ref/source/format.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/crawl-ref/source/format.cc b/crawl-ref/source/format.cc
index 595d2a3f85..400f900dff 100644
--- a/crawl-ref/source/format.cc
+++ b/crawl-ref/source/format.cc
@@ -74,6 +74,18 @@ formatted_string formatted_string::parse_string(
bool invert_colour = false;
std::string::size_type endpos = std::string::npos;
+ // Break string up if it gets too big.
+ if (currs.size() >= 999)
+ {
+ fs.cprintf(currs.substr(0, 999));
+ if (currs.size() > 999)
+ currs = currs.substr(999);
+ else
+ currs.clear();
+ tag--;
+ continue;
+ }
+
if (s[tag] != '<' || tag >= length - 2)
{
if (!masked)