From 9315f47499c9e432fc97e5cd0142e65abd2835f3 Mon Sep 17 00:00:00 2001 From: John Kohl Date: Tue, 13 Feb 1990 16:59:37 +0000 Subject: [PATCH] always print out a newline before exiting git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@361 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/os/read_pwd.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/krb5/os/read_pwd.c b/src/lib/krb5/os/read_pwd.c index c76872610..ccbb64a5c 100644 --- a/src/lib/krb5/os/read_pwd.c +++ b/src/lib/krb5/os/read_pwd.c @@ -92,9 +92,11 @@ int *size_return; if (fgets(return_pwd, *size_return, stdin) == NULL) { /* error */ + (void) putchar('\n'); (void) bzero(return_pwd, *size_return); cleanup(KRB5_LIBOS_CANTREADPWD); } + (void) putchar('\n'); /* fgets always null-terminates the returned string */ /* replace newline with null */ @@ -107,7 +109,6 @@ int *size_return; if (prompt2) { /* put out the prompt */ - (void) putchar('\n'); (void) fputs(prompt2,stdout); (void) fflush(stdout); readin_string = malloc(*size_return); @@ -118,11 +119,14 @@ int *size_return; (void) bzero(readin_string, *size_return); if (fgets(readin_string, *size_return, stdin) == NULL) { /* error */ + (void) putchar('\n'); (void) bzero(readin_string, *size_return); (void) bzero(return_pwd, *size_return); free(readin_string); cleanup(KRB5_LIBOS_CANTREADPWD); } + (void) putchar('\n'); + if (ptr = index(readin_string, '\n')) *ptr = '\0'; else /* need to flush */ -- 2.26.2