Truncate the fgets() return properly.

This commit is contained in:
jkh 1995-12-28 04:51:40 +00:00
parent d046612fef
commit 3cebea6eb9

View File

@ -201,8 +201,9 @@ reprint:
(void) fgets(captain, sizeof captain, stdin);
if (!*captain)
(void) strcpy(captain, "no name");
else
captain[strlen(captain) - 1] = '\0';
}
captain[sizeof captain - 1] = '\0';
Write(W_CAPTAIN, ms, 1, (int)captain, 0, 0, 0);
for (n = 0; n < 2; n++) {
char buf[10];