diff options
Diffstat (limited to 'src/commands/whoami.c')
-rw-r--r-- | src/commands/whoami.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/commands/whoami.c b/src/commands/whoami.c index 623a35a..7fd7c85 100644 --- a/src/commands/whoami.c +++ b/src/commands/whoami.c @@ -9,10 +9,15 @@ static void help(void) { } COMMAND(whoami) { + + uid_t usr; + struct passwd* passwd; + parse_help(argc, argv, help); - uid_t usr = getuid(); - struct passwd* passwd = getpwuid(usr); + usr = getuid(); + passwd = getpwuid(usr); + if (passwd == NULL) { printf("\x1b[1;91myou do not exist.\n"); } else { |