convert() is used by dos2unix and unix2dos
[oweals/busybox.git] / pwd.c
diff --git a/pwd.c b/pwd.c
index 2f36b1f058f231e3c6633da5df18e39a4127d5ff..f6a00bf1e655cba751ba6a26e443dd13398a04ae 100644 (file)
--- a/pwd.c
+++ b/pwd.c
 
 extern int pwd_main(int argc, char **argv)
 {
-       char buf[BUFSIZ + 1];
-
-       if (getcwd(buf, sizeof(buf)) == NULL)
-               perror_msg_and_die("getcwd");
-
-       puts(buf);
-       return EXIT_SUCCESS;
+       static char *buf; 
+       
+       buf = xgetcwd(buf);
+       
+       if (buf != NULL) {
+               puts(buf);
+               return EXIT_SUCCESS;
+       }
+       return EXIT_FAILURE;
 }