summaryrefslogtreecommitdiff
path: root/whoami.c
diff options
context:
space:
mode:
Diffstat (limited to 'whoami.c')
-rw-r--r--whoami.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/whoami.c b/whoami.c
index 6a5dd2c..38a2b30 100644
--- a/whoami.c
+++ b/whoami.c
@@ -26,14 +26,14 @@
extern int whoami_main(int argc, char **argv)
{
- char *user = xmalloc(9);
+ char user[9];
uid_t uid = geteuid();
if (argc > 1)
usage(whoami_usage);
my_getpwuid(user, uid);
- if (user) {
+ if (*user) {
puts(user);
return EXIT_SUCCESS;
}