mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 09:51:57 -05:00
find: Explicitly specify type when converting to uid_t
This reduces the risk of unintentional conversion errors.
This commit is contained in:
parent
bc50b629ee
commit
fa0606ea36
1 changed files with 1 additions and 1 deletions
|
@ -181,7 +181,7 @@ public:
|
|||
m_uid = passwd->pw_uid;
|
||||
} else {
|
||||
// Attempt to parse it as decimal UID.
|
||||
auto number = StringView { arg, strlen(arg) }.to_uint();
|
||||
auto number = StringView { arg, strlen(arg) }.to_uint<uid_t>();
|
||||
if (!number.has_value())
|
||||
fatal_error("Invalid user: \033[1m{}", arg);
|
||||
m_uid = number.value();
|
||||
|
|
Loading…
Add table
Reference in a new issue