summaryrefslogtreecommitdiff
path: root/src/helpers
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-11-10 21:51:46 +0000
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-11-10 21:51:46 +0000
commita5ffd44cafd84f6f324e27c1925573e6cabcc858 (patch)
tree4beadcd0480dc6bda455be43b805fda226e19b64 /src/helpers
parent0208dff574ad87b89de59ee5a4f71781efbcff17 (diff)
guard empty str in removeBeginEndSpacesTabs
Diffstat (limited to 'src/helpers')
-rw-r--r--src/helpers/MiscFunctions.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/helpers/MiscFunctions.cpp b/src/helpers/MiscFunctions.cpp
index c825a1d9..bf20f390 100644
--- a/src/helpers/MiscFunctions.cpp
+++ b/src/helpers/MiscFunctions.cpp
@@ -145,6 +145,9 @@ void scaleBox(wlr_box* box, float scale) {
}
std::string removeBeginEndSpacesTabs(std::string str) {
+ if (str.empty())
+ return str;
+
int countBefore = 0;
while (str[countBefore] == ' ' || str[countBefore] == '\t') {
countBefore++;