mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-23 04:45:59 +01:00
Buffer overflow fix (#1707)
This commit is contained in:
parent
7ce92f93ad
commit
0c8d1ba4a8
1 changed files with 2 additions and 2 deletions
|
@ -209,7 +209,7 @@ std::string removeBeginEndSpacesTabs(std::string str) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int countAfter = 0;
|
int countAfter = 0;
|
||||||
while (str.length() != 0 && (str[str.length() - countAfter - 1] == ' ' || str[str.length() - 1 - countAfter] == '\t')) {
|
while ((int)str.length() - countAfter - 1 >= 0 && (str[str.length() - countAfter - 1] == ' ' || str[str.length() - 1 - countAfter] == '\t')) {
|
||||||
countAfter++;
|
countAfter++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue