mirror of
https://github.com/hyprwm/Hyprland
synced 2024-12-22 11:09:49 +01:00
guard empty str in isNumber
This commit is contained in:
parent
13befbd266
commit
61995e3b4e
1 changed files with 2 additions and 0 deletions
|
@ -251,6 +251,8 @@ std::deque<std::string> splitArgs(int argc, char** argv) {
|
|||
}
|
||||
|
||||
bool isNumber(const std::string& str, bool allowfloat) {
|
||||
if (str.empty())
|
||||
return false;
|
||||
return std::ranges::all_of(str.begin(), str.end(), [&](char c) { return isdigit(c) != 0 || c == '-' || (allowfloat && c == '.'); });
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue