gets -> fgets
Submitted by: fn@@pain.csrv.uidaho.edu
This commit is contained in:
parent
014374187c
commit
9f234b3662
@ -198,7 +198,7 @@ reprint:
|
|||||||
else {
|
else {
|
||||||
(void) printf("Your name, Captain? ");
|
(void) printf("Your name, Captain? ");
|
||||||
(void) fflush(stdout);
|
(void) fflush(stdout);
|
||||||
(void) gets(captain);
|
(void) fgets(captain, sizeof captain, stdin);
|
||||||
if (!*captain)
|
if (!*captain)
|
||||||
(void) strcpy(captain, "no name");
|
(void) strcpy(captain, "no name");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user