Truncate the fgets() return properly.
This commit is contained in:
parent
737af07cff
commit
2a510f5c12
@ -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];
|
||||
|
Loading…
Reference in New Issue
Block a user