From 7c60998459faffc1746f53aae5cff29c793be231 Mon Sep 17 00:00:00 2001 From: Michael Carlberg Date: Tue, 22 Nov 2016 21:14:34 +0100 Subject: [PATCH] fix(label): Patch token extraction Ref #182 --- src/drawtypes/label.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/drawtypes/label.cpp b/src/drawtypes/label.cpp index 2d17c3c9..71e8d655 100644 --- a/src/drawtypes/label.cpp +++ b/src/drawtypes/label.cpp @@ -86,9 +86,9 @@ namespace drawtypes { string line{text}; while ((start = line.find('%')) != string::npos && (end = line.find('%', start + 1)) != string::npos) { - auto token = line.substr(start, end + 1); + auto token = line.substr(start, end - start + 1); - line.erase(0, end); + line.erase(start, end - start + 1); // ignore false positives (lemonbar-style declarations) if (token[1] == '{')