mirror of
https://github.com/hyprwm/Hyprland
synced 2024-12-22 18:49:49 +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;
|
||||
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++;
|
||||
}
|
||||
|
||||
|
@ -562,4 +562,4 @@ std::string replaceInString(std::string subject, const std::string& search, cons
|
|||
pos += replace.length();
|
||||
}
|
||||
return subject;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue