Update the lash shell (hopefully the last time...) so things like
[oweals/busybox.git] / logname.c
index 1fc518bfce36135cfff7201a3dedc766426aa270..0924b24712628d4e644a472e2ac68ed8d4b497a7 100644 (file)
--- a/logname.c
+++ b/logname.c
  *
  */
 
-#include "busybox.h"
 #include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include "busybox.h"
 
 extern int logname_main(int argc, char **argv)
 {
-       char *user = xmalloc(9);
+       char user[9];
 
        if (argc > 1)
-               usage(logname_usage);
+               show_usage();
 
        my_getpwuid(user, geteuid());
-       if (user) {
+       if (*user) {
                puts(user);
                return EXIT_SUCCESS;
        }
-       error_msg_and_die("no login name\n");
+       error_msg_and_die("no login name");
 }