summaryrefslogtreecommitdiff
path: root/games
diff options
context:
space:
mode:
authorPaul Janzen <pjanzen@cvs.openbsd.org>1999-03-27 05:07:08 +0000
committerPaul Janzen <pjanzen@cvs.openbsd.org>1999-03-27 05:07:08 +0000
commit2afff778427a17b38b9ebedd4bb658d36eee20c3 (patch)
treeaa09d07d0f04cc1a17b1b19784eeeb9fab48e654 /games
parent41e8ac3248416145b0918cadce82cb35de96001e (diff)
Fix rev 1.4
Diffstat (limited to 'games')
-rw-r--r--games/sail/pl_main.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/games/sail/pl_main.c b/games/sail/pl_main.c
index 9f2dfc3a839..b9e958a7599 100644
--- a/games/sail/pl_main.c
+++ b/games/sail/pl_main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pl_main.c,v 1.4 1999/03/26 02:35:53 pjanzen Exp $ */
+/* $OpenBSD: pl_main.c,v 1.5 1999/03/27 05:07:07 pjanzen Exp $ */
/* $NetBSD: pl_main.c,v 1.5 1995/04/24 12:25:25 cgd Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)pl_main.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: pl_main.c,v 1.4 1999/03/26 02:35:53 pjanzen Exp $";
+static char rcsid[] = "$OpenBSD: pl_main.c,v 1.5 1999/03/27 05:07:07 pjanzen Exp $";
#endif
#endif /* not lint */
@@ -198,10 +198,10 @@ reprint:
(void) printf("Your name, Captain? ");
(void) fflush(stdout);
(void) fgets(captain, sizeof captain, stdin);
- if (!*captain)
+ if (!*captain || *captain == '\n')
(void) strcpy(captain, "no name");
- else
- captain[sizeof(captain) - 1] = '\0';
+ else if (captain[strlen(captain) - 1] == '\n')
+ captain[strlen(captain) - 1] = '\0';
}
Writestr(W_CAPTAIN, ms, captain);
for (n = 0; n < 2; n++) {