diff options
author | Eric Andersen <andersen@codepoet.org> | 2000-12-13 04:52:39 +0300 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2000-12-13 04:52:39 +0300 |
commit | bd193a42a5624f0a72b5f99d554e9a8d2afc64cc (patch) | |
tree | 7aacebe98730fbfee623943425a100fd158ba48a /coreutils/logname.c | |
parent | 77508b29fa63d99136fc09f00c5a2addd6331b4c (diff) |
Fix from Matt Kraai -- a better way to NULL terminate strings for the
my_* passwd and group routines. I should have thought of doing it
this way...
Diffstat (limited to 'coreutils/logname.c')
-rw-r--r-- | coreutils/logname.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/coreutils/logname.c b/coreutils/logname.c index 1fc518bfc..d614e85f1 100644 --- a/coreutils/logname.c +++ b/coreutils/logname.c @@ -25,13 +25,13 @@ extern int logname_main(int argc, char **argv) { - char *user = xmalloc(9); + char user[9]; if (argc > 1) usage(logname_usage); my_getpwuid(user, geteuid()); - if (user) { + if (*user) { puts(user); return EXIT_SUCCESS; } |