diff options
Diffstat (limited to 'pwd.c')
-rw-r--r-- | pwd.c | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -32,11 +32,13 @@ | |||
32 | 32 | ||
33 | extern int pwd_main(int argc, char **argv) | 33 | extern int pwd_main(int argc, char **argv) |
34 | { | 34 | { |
35 | char buf[BUFSIZ + 1]; | 35 | static char *buf; |
36 | 36 | ||
37 | if (getcwd(buf, sizeof(buf)) == NULL) | 37 | buf = xgetcwd(buf); |
38 | perror_msg_and_die("getcwd"); | 38 | |
39 | 39 | if (buf != NULL) { | |
40 | puts(buf); | 40 | puts(buf); |
41 | return EXIT_SUCCESS; | 41 | return EXIT_SUCCESS; |
42 | } | ||
43 | return EXIT_FAILURE; | ||
42 | } | 44 | } |