summaryrefslogtreecommitdiff
path: root/lib/libc/pwd
diff options
context:
space:
mode:
authorKacper <kacper@mail.openlinux.dev>2025-12-25 19:24:38 +0100
committerKacper <kacper@mail.openlinux.dev>2025-12-25 20:35:03 +0100
commita984eb367c032dbe2577f01238c3d1268526be70 (patch)
tree437fef40379b2758b129ccea39df3570fa2d145e /lib/libc/pwd
parent8834571b202cf4dc9c649cfb096c213b6ecf1566 (diff)
Clang-tidy fixes
Diffstat (limited to 'lib/libc/pwd')
-rw-r--r--lib/libc/pwd/getgrgid_r.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/libc/pwd/getgrgid_r.c b/lib/libc/pwd/getgrgid_r.c
index 2f9c1952..0aec3e08 100644
--- a/lib/libc/pwd/getgrgid_r.c
+++ b/lib/libc/pwd/getgrgid_r.c
@@ -20,8 +20,7 @@ static char *copy_str(const char *src, char **buf, size_t *buflen)
return dst;
}
-int getpwuid_r(uid_t uid, struct passwd *pwd, char *buf, size_t buflen,
- struct passwd **result)
+int getpwuid_r(uid_t uid, struct passwd *pwd, char *buf, size_t buflen, struct passwd **result)
{
FILE *stream = fopen("/etc/passwd", "r");
if (stream == NULL) {
@@ -40,8 +39,7 @@ int getpwuid_r(uid_t uid, struct passwd *pwd, char *buf, size_t buflen,
char *dir = strtok(NULL, ":");
char *shell = strtok(NULL, "\n");
- if (name == NULL || passwd == NULL || uid_str == NULL ||
- gid_str == NULL)
+ if (name == NULL || passwd == NULL || uid_str == NULL || gid_str == NULL)
continue;
uid_t file_uid = (uid_t)strtoul(uid_str, NULL, 10);
@@ -58,8 +56,7 @@ int getpwuid_r(uid_t uid, struct passwd *pwd, char *buf, size_t buflen,
pwd->pw_uid = file_uid;
pwd->pw_gid = (gid_t)strtoul(gid_str, NULL, 10);
- if (pwd->pw_name == NULL || pwd->pw_dir == NULL ||
- pwd->pw_shell == NULL) {
+ if (pwd->pw_name == NULL || pwd->pw_dir == NULL || pwd->pw_shell == NULL) {
fclose(stream);
return ERANGE;
}