find: Explicitly specify type when converting to uid_t

This reduces the risk of unintentional conversion errors.
This commit is contained in:
Tim Ledbetter 2023-08-29 12:41:34 +01:00 committed by Tim Flynn
parent bc50b629ee
commit fa0606ea36

View file

@ -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();