summary refs log tree commit diff homepage
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2019-05-23 19:55:25 -0400
committerJune McEnroe <june@causal.agency>2019-05-23 19:55:25 -0400
commit2945790e77d49b764b4b36155c44e39660aed27a (patch)
treeaccd883dda126c463c897de5745cf3acb5a7f3c6
parentOpen path given to -t read-only (diff)
downloadplay-2945790e77d49b764b4b36155c44e39660aed27a.tar.gz
play-2945790e77d49b764b4b36155c44e39660aed27a.zip
Prevent blank name fields
Diffstat (limited to '')
-rw-r--r--play.c7
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 = ' ';
 		}