diff options
Diffstat (limited to 'src/qbiff.c')
-rw-r--r-- | src/qbiff.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/qbiff.c b/src/qbiff.c index 186e524..800e1f2 100644 --- a/src/qbiff.c +++ b/src/qbiff.c @@ -2,7 +2,19 @@ #include <sys/types.h> #include <unistd.h> +#include "buffer.h" +#include "byte.h" +#include "env.h" +#include "exit.h" +#include "open.h" +#include "str.h" +#include "stralloc.h" + #include "hasutmp.h" +#include "headerbody.h" +#include "hfield.h" + + #ifdef HASUTMP #include <utmp.h> #ifndef UTMP_FILE @@ -15,16 +27,6 @@ #else #include <utmpx.h> #endif -#include "buffer.h" -#include "byte.h" -#include "env.h" -#include "exit.h" -#include "open.h" -#include "str.h" -#include "stralloc.h" - -#include "headerbody.h" -#include "hfield.h" buffer b; #ifdef HASUTMP @@ -67,10 +69,7 @@ void doheader(stralloc *h) } } -void finishheader() -{ - ; -} +void finishheader() {} int main() { @@ -117,10 +116,10 @@ int main() if (fdutmp == -1) _exit(0); buffer_init(&b, read, fdutmp, bufutmp, sizeof(bufutmp)); - while (buffer_get(&b, &ut, sizeof(ut)) == sizeof(ut)) + while (buffer_get(&b, &ut, sizeof(ut)) == sizeof(ut)) { if (!str_diffn(ut.ut_name, user, sizeof(ut.ut_name))) { #else - while ((ut = getutxent()) != 0) + while ((ut = getutxent()) != 0) { if (ut->ut_type == USER_PROCESS && !str_diffn(ut->ut_user, user, sizeof(ut->ut_user))) { #endif #ifdef HASUTMP @@ -152,5 +151,6 @@ int main() buffer_putflush(&b, woof.s, woof.len); close(fdtty); } + } _exit(0); } |