From dffdc6a20b76b05215c16b06aa6a569f5de73e7d Mon Sep 17 00:00:00 2001 From: Michael Carlberg Date: Fri, 30 Dec 2016 20:34:13 +0100 Subject: [PATCH] fix(builder): Sub-string check Fixes #282 --- src/components/builder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/builder.cpp b/src/components/builder.cpp index af2a4ee1..e229a228 100644 --- a/src/components/builder.cpp +++ b/src/components/builder.cpp @@ -313,7 +313,7 @@ void builder::space() { void builder::remove_trailing_space(size_t len) { if (len == 0_z || len > m_output.size()) { return; - } else if (string(m_output.rbegin() + len, m_output.rbegin()) == string(len, ' ')) { + } else if (m_output.substr(m_output.size() - len) == string(len, ' ')) { m_output.erase(m_output.size() - len); } }