1
0
mirror of https://github.com/openbsd/src.git synced 2025-01-10 06:47:55 -08:00

clear to end of line when printing error messages so that previous

messages don't remain and pollute the line
This commit is contained in:
tedu 2015-02-07 01:43:51 +00:00
parent 2ddfbac012
commit 65b0e16c1a

View File

@ -1,4 +1,4 @@
/* $OpenBSD: getguess.c,v 1.9 2009/10/27 23:59:25 deraadt Exp $ */
/* $OpenBSD: getguess.c,v 1.10 2015/02/07 01:43:51 tedu Exp $ */
/* $NetBSD: getguess.c,v 1.5 1995/03/23 08:32:43 cgd Exp $ */
/*
@ -52,17 +52,22 @@ getguess(void)
if (isalpha(ch)) {
if (isupper(ch))
ch = tolower(ch);
if (Guessed[ch - 'a'])
if (Guessed[ch - 'a']) {
move(MESGY, MESGX);
clrtoeol();
mvprintw(MESGY, MESGX, "Already guessed '%c'",
ch);
else
} else
break;
} else
if (ch == CTRL('D'))
die(0);
else
else {
move(MESGY, MESGX);
clrtoeol();
mvprintw(MESGY, MESGX,
"Not a valid guess: '%s'", unctrl(ch));
}
}
leaveok(stdscr, TRUE);
move(MESGY, MESGX);