mirror of
https://github.com/Trensa-Organization/Hyprland.git
synced 2025-03-15 10:43:39 +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…
Add table
Reference in a new issue