summaryrefslogtreecommitdiff
path: root/libc/pwd_grp/getpw.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2000-10-07 23:46:22 +0000
committerEric Andersen <andersen@codepoet.org>2000-10-07 23:46:22 +0000
commite2aa1f4fa9a36d223e271cc24dfad691f6a56d12 (patch)
treeff7678cf744386be5015ae0385a83410ddaca4d9 /libc/pwd_grp/getpw.c
parent59030d6f8ae481f69966aa9e1062af461b50e1b0 (diff)
Formatting update
Diffstat (limited to 'libc/pwd_grp/getpw.c')
-rw-r--r--libc/pwd_grp/getpw.c45
1 files changed, 20 insertions, 25 deletions
diff --git a/libc/pwd_grp/getpw.c b/libc/pwd_grp/getpw.c
index 4f4e39025..f0663c917 100644
--- a/libc/pwd_grp/getpw.c
+++ b/libc/pwd_grp/getpw.c
@@ -23,29 +23,24 @@
#include <stdio.h>
#include <pwd.h>
-int
-getpw(uid_t uid, char *buf)
+int getpw(uid_t uid, char *buf)
{
- struct passwd * passwd;
-
- if (buf==NULL)
- {
- errno=EINVAL;
- return -1;
- }
- if ((passwd=getpwuid(uid))==NULL)
- return -1;
-
- if (sprintf(buf, "%s:%s:%u:%u:%s:%s:%s", passwd->pw_name, passwd->pw_passwd,
- passwd->pw_gid, passwd->pw_uid, passwd->pw_gecos,
- passwd->pw_dir, passwd->pw_shell)<0)
- {
- errno=ENOBUFS;
- return -1;
- }
-
- return 0;
-}
-
-
-
+ struct passwd *passwd;
+
+ if (buf == NULL) {
+ errno = EINVAL;
+ return -1;
+ }
+ if ((passwd = getpwuid(uid)) == NULL)
+ return -1;
+
+ if (sprintf
+ (buf, "%s:%s:%u:%u:%s:%s:%s", passwd->pw_name, passwd->pw_passwd,
+ passwd->pw_gid, passwd->pw_uid, passwd->pw_gecos, passwd->pw_dir,
+ passwd->pw_shell) < 0) {
+ errno = ENOBUFS;
+ return -1;
+ }
+
+ return 0;
+}