From 22c71cec18c5e73e3cd90afaec6bd625fd81cd18 Mon Sep 17 00:00:00 2001 From: MiroslavR Date: Mon, 22 Sep 2014 23:17:44 +0200 Subject: [PATCH] Check for text size --- apps/openmw/mwgui/formatting.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/apps/openmw/mwgui/formatting.cpp b/apps/openmw/mwgui/formatting.cpp index 7de4950ee..d838ae8af 100644 --- a/apps/openmw/mwgui/formatting.cpp +++ b/apps/openmw/mwgui/formatting.cpp @@ -202,10 +202,8 @@ namespace MWGui // hack: prevent newlines at the end of the book possibly creating unnecessary pages if (event == BookTextParser::Event_EOF) { - while (plainText[plainText.size()-1] == '\n') - { + while (plainText.size() && plainText[plainText.size()-1] == '\n') plainText.erase(plainText.end()-1); - } } #endif