diff options
author | June McEnroe <june@causal.agency> | 2019-05-23 19:55:25 -0400 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2019-05-23 19:55:25 -0400 |
commit | 2945790e77d49b764b4b36155c44e39660aed27a (patch) | |
tree | accd883dda126c463c897de5745cf3acb5a7f3c6 | |
parent | Open path given to -t read-only (diff) | |
download | play-2945790e77d49b764b4b36155c44e39660aed27a.tar.gz play-2945790e77d49b764b4b36155c44e39660aed27a.zip |
Prevent blank name fields
-rw-r--r-- | play.c | 7 |
1 files changed, 6 insertions, 1 deletions
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 = ' '; } |