mirror of
https://github.com/hyprwm/Hyprland.git
synced 2024-09-11 05:15:39 +03:00
guard empty str in isNumber
This commit is contained in:
parent
13befbd266
commit
61995e3b4e
@ -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 New Issue
Block a user