=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ftp/cmds.c,v retrieving revision 1.58 retrieving revision 1.59 diff -c -r1.58 -r1.59 *** src/usr.bin/ftp/cmds.c 2008/05/13 02:09:38 1.58 --- src/usr.bin/ftp/cmds.c 2008/06/15 03:09:13 1.59 *************** *** 1,4 **** ! /* $OpenBSD: cmds.c,v 1.58 2008/05/13 02:09:38 ray Exp $ */ /* $NetBSD: cmds.c,v 1.27 1997/08/18 10:20:15 lukem Exp $ */ /* --- 1,4 ---- ! /* $OpenBSD: cmds.c,v 1.59 2008/06/15 03:09:13 martynas Exp $ */ /* $NetBSD: cmds.c,v 1.27 1997/08/18 10:20:15 lukem Exp $ */ /* *************** *** 60,66 **** */ #if !defined(lint) && !defined(SMALL) ! static const char rcsid[] = "$OpenBSD: cmds.c,v 1.58 2008/05/13 02:09:38 ray Exp $"; #endif /* not lint and not SMALL */ /* --- 60,66 ---- */ #if !defined(lint) && !defined(SMALL) ! static const char rcsid[] = "$OpenBSD: cmds.c,v 1.59 2008/06/15 03:09:13 martynas Exp $"; #endif /* not lint and not SMALL */ /* *************** *** 1259,1266 **** if (argc < 4) { (void)fputs("Account: ", ttyout); (void)fflush(ttyout); ! if (fgets(acctname, sizeof(acctname), stdin) == NULL) goto fail; acctname[strcspn(acctname, "\n")] = '\0'; --- 1259,1268 ---- if (argc < 4) { (void)fputs("Account: ", ttyout); (void)fflush(ttyout); ! if (fgets(acctname, sizeof(acctname), stdin) == NULL) { ! clearerr(stdin); goto fail; + } acctname[strcspn(acctname, "\n")] = '\0';