mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-29 04:21:26 +01:00
Truncate the fgets() return properly.
This commit is contained in:
parent
d046612fef
commit
3cebea6eb9
@ -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];
|
||||
|
Loading…
Reference in New Issue
Block a user