mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-23 02:45:58 +01:00
Merge pull request #69 from mdartmann/fix-underflow-remove-begin-end-spaces-tabs
Fix string underflow in `removeBeginEndSpacesTabs()`
This commit is contained in:
commit
0de058beb1
1 changed files with 1 additions and 1 deletions
|
@ -69,7 +69,7 @@ std::string removeBeginEndSpacesTabs(std::string str) {
|
|||
str = str.substr(1);
|
||||
}
|
||||
|
||||
while (str[str.length() - 1] == ' ' || str[str.length() - 1] == '\t') {
|
||||
while (str.length() != 0 && (str[str.length() - 1] == ' ' || str[str.length() - 1] == '\t')) {
|
||||
str = str.substr(0, str.length() - 1);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue