diff options
author | Idan Horowitz <idan.horowitz@gmail.com> | 2022-04-01 20:58:27 +0300 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-04-01 21:24:45 +0100 |
commit | 086969277e74d8ba065bf8145d3aeb0dec0bfee5 (patch) | |
tree | 02b3699a66735ef806d9b46353491f18f8e4e7b4 /Userland/Libraries/LibC/pwd.cpp | |
parent | 0376c127f6e98e03607700d0b3f5154b7014b2f8 (diff) | |
download | serenity-086969277e74d8ba065bf8145d3aeb0dec0bfee5.zip |
Everywhere: Run clang-format
Diffstat (limited to 'Userland/Libraries/LibC/pwd.cpp')
-rw-r--r-- | Userland/Libraries/LibC/pwd.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Userland/Libraries/LibC/pwd.cpp b/Userland/Libraries/LibC/pwd.cpp index e55691d592..6b47b3d6f9 100644 --- a/Userland/Libraries/LibC/pwd.cpp +++ b/Userland/Libraries/LibC/pwd.cpp @@ -66,7 +66,7 @@ struct passwd* getpwuid(uid_t uid) return nullptr; } -struct passwd* getpwnam(const char* name) +struct passwd* getpwnam(char const* name) { setpwent(); while (auto* pw = getpwent()) { @@ -76,7 +76,7 @@ struct passwd* getpwnam(const char* name) return nullptr; } -static bool parse_pwddb_entry(const String& line) +static bool parse_pwddb_entry(String const& line) { auto parts = line.split_view(':', true); if (parts.size() != 7) { @@ -168,7 +168,7 @@ static void construct_pwd(struct passwd* pwd, char* buf, struct passwd** result) pwd->pw_shell = buf_shell; } -int getpwnam_r(const char* name, struct passwd* pwd, char* buf, size_t buflen, struct passwd** result) +int getpwnam_r(char const* name, struct passwd* pwd, char* buf, size_t buflen, struct passwd** result) { // FIXME: This is a HACK! TemporaryChange name_change { s_name, {} }; @@ -191,7 +191,7 @@ int getpwnam_r(const char* name, struct passwd* pwd, char* buf, size_t buflen, s return 0; } - const auto total_buffer_length = s_name.length() + s_passwd.length() + s_gecos.length() + s_dir.length() + s_shell.length() + 5; + auto const total_buffer_length = s_name.length() + s_passwd.length() + s_gecos.length() + s_dir.length() + s_shell.length() + 5; if (buflen < total_buffer_length) return ERANGE; @@ -222,7 +222,7 @@ int getpwuid_r(uid_t uid, struct passwd* pwd, char* buf, size_t buflen, struct p return 0; } - const auto total_buffer_length = s_name.length() + s_passwd.length() + s_gecos.length() + s_dir.length() + s_shell.length() + 5; + auto const total_buffer_length = s_name.length() + s_passwd.length() + s_gecos.length() + s_dir.length() + s_shell.length() + 5; if (buflen < total_buffer_length) return ERANGE; @@ -237,7 +237,7 @@ int putpwent(const struct passwd* p, FILE* stream) return -1; } - auto is_valid_field = [](const char* str) { + auto is_valid_field = [](char const* str) { return str && !strpbrk(str, ":\n"); }; |