summaryrefslogtreecommitdiff
path: root/lib/libutil/pw_util.c
diff options
context:
space:
mode:
authorWolfram Schneider <wosch@FreeBSD.org>1997-09-29 13:13:51 +0000
committerWolfram Schneider <wosch@FreeBSD.org>1997-09-29 13:13:51 +0000
commit2af22b06a437a375417b004d7dfad34cdb237e47 (patch)
tree3f8fbb9f1cd2f24c6b31b69dee776a5cd0aafe29 /lib/libutil/pw_util.c
parenta203eb6ef6eae21cfcee2aaa5dc28532f7771b73 (diff)
Notes
Diffstat (limited to 'lib/libutil/pw_util.c')
-rw-r--r--lib/libutil/pw_util.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/libutil/pw_util.c b/lib/libutil/pw_util.c
index 6283b95bdcf1..21e0ca5c7e05 100644
--- a/lib/libutil/pw_util.c
+++ b/lib/libutil/pw_util.c
@@ -202,14 +202,14 @@ pw_edit(notsetuid)
void
pw_prompt()
{
- int c;
+ int c, first;
(void)printf("re-edit the password file? [y]: ");
(void)fflush(stdout);
- c = getchar();
- if (c != EOF && c != '\n')
- while (getchar() != '\n');
- if (c == 'n')
+ first = c = getchar();
+ while (c != '\n' && c != EOF)
+ c = getchar();
+ if (first == 'n')
pw_error(NULL, 0, 0);
}