mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 08:08:12 +00: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;
|
m_uid = passwd->pw_uid;
|
||||||
} else {
|
} else {
|
||||||
// Attempt to parse it as decimal UID.
|
// 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())
|
if (!number.has_value())
|
||||||
fatal_error("Invalid user: \033[1m{}", arg);
|
fatal_error("Invalid user: \033[1m{}", arg);
|
||||||
m_uid = number.value();
|
m_uid = number.value();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue