}
int login_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
-int login_main(int argc, char **argv)
+int login_main(int argc ATTRIBUTE_UNUSED, char **argv)
{
enum {
LOGIN_OPT_f = (1<<0),
bb_error_msg_and_die("-f is for root only");
safe_strncpy(username, opt_user, sizeof(username));
}
- if (optind < argc) /* user from command line (getty) */
- safe_strncpy(username, argv[optind], sizeof(username));
+ argv += optind;
+ if (argv[0]) /* user from command line (getty) */
+ safe_strncpy(username, argv[0], sizeof(username));
/* Let's find out and memorize our tty */
if (!isatty(0) || !isatty(1) || !isatty(2))