From 2945790e77d49b764b4b36155c44e39660aed27a Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Thu, 23 May 2019 19:55:25 -0400 Subject: Prevent blank name fields --- play.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/play.c b/play.c index 5940d34..3083383 100644 --- a/play.c +++ b/play.c @@ -217,7 +217,12 @@ int main(int argc, char *argv[]) { draw(index); if (index < ScoresLen) { attr_set(A_BOLD, 0, NULL); - getnstr(new.name, sizeof(new.name) - 1); + while (!new.name[0]) { + int y, x; + getyx(stdscr, y, x); + getnstr(new.name, sizeof(new.name) - 1); + move(y, x); + } for (char *ch = new.name; *ch; ++ch) { if (*ch < ' ') *ch = ' '; } -- cgit 1.4.1