hush: move msh/lash config into hush.c, no code changes
[oweals/busybox.git] / loginutils / cryptpw.c
index c179e35cfabecaa3c3a19bff6d8af6e7f71123c6..b44993f06ee9396a535a0a2c51ebb9afd0dd5111 100644 (file)
@@ -1,9 +1,13 @@
 /* vi: set sw=4 ts=4: */
 /*
- * cryptpw.c
+ * cryptpw.c - output a crypt(3)ed password to stdout.
+ *
+ * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
  *
  * Cooked from passwd.c by Thomas Lundquist <thomasez@zelow.no>
  * mkpasswd compatible options added by Bernhard Reutner-Fischer
+ *
+ * Licensed under GPLv2, see file LICENSE in this tarball for details.
  */
 
 #include "libbb.h"
@@ -56,7 +60,7 @@ int cryptpw_main(int argc UNUSED_PARAM, char **argv)
        int len;
        int fd;
 
-#if ENABLE_GETOPT_LONG
+#if ENABLE_LONG_OPTS
        static const char mkpasswd_longopts[] ALIGN1 =
                "stdin\0"       No_argument       "s"
                "password-fd\0" Required_argument "P"
@@ -103,8 +107,8 @@ int cryptpw_main(int argc UNUSED_PARAM, char **argv)
                argv[0] ? argv[0] : (
                        /* Only mkpasswd, and only from tty, prompts.
                         * Otherwise it is a plain read. */
-                       (isatty(0) && applet_name[0] == 'm')
-                       ? bb_ask(STDIN_FILENO, 0, "Password: ")
+                       (isatty(STDIN_FILENO) && applet_name[0] == 'm')
+                       ? bb_ask_stdin("Password: ")
                        : xmalloc_fgetline(stdin)
                ),
                salt, 1));