mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-09 00:21:56 -07:00
Fix string underflow in removeBeginEndSpacesTabs()
Signed-off-by: Mae Dartmann <hello@maedartmann.name> Changes to be committed: modified: src/helpers/MiscFunctions.cpp
This commit is contained in:
@@ -69,7 +69,7 @@ std::string removeBeginEndSpacesTabs(std::string str) {
|
|||||||
str = str.substr(1);
|
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);
|
str = str.substr(0, str.length() - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user