mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-01 20:51:58 -07:00
guard empty str in removeBeginEndSpacesTabs
This commit is contained in:
@@ -145,6 +145,9 @@ void scaleBox(wlr_box* box, float scale) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string removeBeginEndSpacesTabs(std::string str) {
|
std::string removeBeginEndSpacesTabs(std::string str) {
|
||||||
|
if (str.empty())
|
||||||
|
return str;
|
||||||
|
|
||||||
int countBefore = 0;
|
int countBefore = 0;
|
||||||
while (str[countBefore] == ' ' || str[countBefore] == '\t') {
|
while (str[countBefore] == ' ' || str[countBefore] == '\t') {
|
||||||
countBefore++;
|
countBefore++;
|
||||||
|
Reference in New Issue
Block a user