Truncate the fgets() return properly.

This commit is contained in:
Jordan K. Hubbard 1995-12-28 04:51:40 +00:00
parent 737af07cff
commit 2a510f5c12

View File

@ -201,8 +201,9 @@ initialize()
(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];