From a6a7d6ce079cabdaf2fa502b2e2cf15e5428ac6f Mon Sep 17 00:00:00 2001 From: Jannis Hoffmann Date: Wed, 3 Jul 2024 15:52:39 +0200 Subject: format files --- src/qmail-getpw.c | 51 ++++++++++++++++++++++++++++----------------------- 1 file changed, 28 insertions(+), 23 deletions(-) (limited to 'src/qmail-getpw.c') diff --git a/src/qmail-getpw.c b/src/qmail-getpw.c index f801c3c..9de7ec6 100644 --- a/src/qmail-getpw.c +++ b/src/qmail-getpw.c @@ -1,16 +1,18 @@ -#include -#include #include +#include +#include #include -#include "error.h" + #include "buffer.h" -#include "exit.h" #include "byte.h" -#include "str.h" #include "case.h" +#include "error.h" +#include "exit.h" #include "fmt.h" -#include "auto_usera.h" +#include "str.h" + #include "auto_break.h" +#include "auto_usera.h" #include "qlx.h" #define GETPW_USERLEN 32 @@ -29,7 +31,7 @@ int userext() for (;;) { if (extension - local < sizeof(username)) if (!*extension || (*extension == *auto_break)) { - byte_copy(username,extension - local,local); + byte_copy(username, extension - local, local); username[extension - local] = 0; case_lowers(username); errno = 0; @@ -37,24 +39,27 @@ int userext() if (errno == ETXTBSY) _exit(QLX_SYS); if (pw) if (pw->pw_uid) - if (stat(pw->pw_dir,&st) == 0) { + if (stat(pw->pw_dir, &st) == 0) { if (st.st_uid == pw->pw_uid) { dash = ""; - if (*extension) { ++extension; dash = "-"; } + if (*extension) { + ++extension; + dash = "-"; + } return 1; } } else { if (errno) _exit(QLX_NFS); } } - if (extension == local) return 0; + if (extension == local) return 0; --extension; } } char num[FMT_ULONG]; -int main(int argc,char **argv) +int main(int argc, char **argv) { local = argv[1]; if (!local) _exit(100); @@ -67,18 +72,18 @@ int main(int argc,char **argv) if (!pw) _exit(QLX_NOALIAS); - buffer_puts(buffer_1small,pw->pw_name); - buffer_put(buffer_1small,"",1); - buffer_put(buffer_1small,num,fmt_ulong(num,(long) pw->pw_uid)); - buffer_put(buffer_1small,"",1); - buffer_put(buffer_1small,num,fmt_ulong(num,(long) pw->pw_gid)); - buffer_put(buffer_1small,"",1); - buffer_puts(buffer_1small,pw->pw_dir); - buffer_put(buffer_1small,"",1); - buffer_puts(buffer_1small,dash); - buffer_put(buffer_1small,"",1); - buffer_puts(buffer_1small,extension); - buffer_put(buffer_1small,"",1); + buffer_puts(buffer_1small, pw->pw_name); + buffer_put(buffer_1small, "", 1); + buffer_put(buffer_1small, num, fmt_ulong(num, (long)pw->pw_uid)); + buffer_put(buffer_1small, "", 1); + buffer_put(buffer_1small, num, fmt_ulong(num, (long)pw->pw_gid)); + buffer_put(buffer_1small, "", 1); + buffer_puts(buffer_1small, pw->pw_dir); + buffer_put(buffer_1small, "", 1); + buffer_puts(buffer_1small, dash); + buffer_put(buffer_1small, "", 1); + buffer_puts(buffer_1small, extension); + buffer_put(buffer_1small, "", 1); buffer_flush(buffer_1small); _exit(0); -- cgit v1.2.3