diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-11-10 21:51:46 +0000 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-11-10 21:51:46 +0000 |
| commit | a5ffd44cafd84f6f324e27c1925573e6cabcc858 (patch) | |
| tree | 4beadcd0480dc6bda455be43b805fda226e19b64 /src/helpers/MiscFunctions.cpp | |
| parent | 0208dff574ad87b89de59ee5a4f71781efbcff17 (diff) | |
guard empty str in removeBeginEndSpacesTabs
Diffstat (limited to 'src/helpers/MiscFunctions.cpp')
| -rw-r--r-- | src/helpers/MiscFunctions.cpp | 3 |
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++; |
