diff options
| author | John Kohl <jtkohl@mit.edu> | 1990-02-13 16:59:37 +0000 |
|---|---|---|
| committer | John Kohl <jtkohl@mit.edu> | 1990-02-13 16:59:37 +0000 |
| commit | 9315f47499c9e432fc97e5cd0142e65abd2835f3 (patch) | |
| tree | 7ce602b2155a3a8a1ec302940e1716b8fa56ccca /src | |
| parent | 0101713b5ab230c8cce3562ce3f403e6380916db (diff) | |
| download | krb5-9315f47499c9e432fc97e5cd0142e65abd2835f3.tar.gz krb5-9315f47499c9e432fc97e5cd0142e65abd2835f3.tar.xz krb5-9315f47499c9e432fc97e5cd0142e65abd2835f3.zip | |
always print out a newline before exiting
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@361 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/krb5/os/read_pwd.c | 6 |
1 files changed, 5 insertions, 1 deletions
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 */ |
