diff options
author | jkh <jkh@FreeBSD.org> | 1995-12-01 08:10:17 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1995-12-01 08:10:17 +0000 |
commit | eb9ddde393712fc3cfb8fc9c11001b0b5c6cadd9 (patch) | |
tree | 0af9845efefbc4587933fd9470be2a3fb6e5e46a | |
parent | 6fdccca095256c8741f6ec285f7be1a779ea7831 (diff) | |
download | FreeBSD-src-eb9ddde393712fc3cfb8fc9c11001b0b5c6cadd9.zip FreeBSD-src-eb9ddde393712fc3cfb8fc9c11001b0b5c6cadd9.tar.gz |
gets() -> fgets(). I'm tired of looking at the compiler messages!
-rw-r--r-- | games/backgammon/common_source/backgammon.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/games/backgammon/common_source/backgammon.c b/games/backgammon/common_source/backgammon.c index 1385fa7..6e00a5a 100644 --- a/games/backgammon/common_source/backgammon.c +++ b/games/backgammon/common_source/backgammon.c @@ -94,14 +94,14 @@ main() srand(time(0)); go[5] = NIL; fprintf(stdout, "Instructions? "); - gets(s); + fgets(s, 100, stdin); if(*s == 'y') instructions(); putchar('\n'); fprintf(stdout, "Opponent's level: b - beginner,\n"); fprintf(stdout, "i - intermediate, e - expert? "); level='e'; - gets(s); + fgets(s, 100, stdin); if(*s == 'b') level = 'b'; else if(*s == 'i') @@ -109,12 +109,12 @@ main() putchar('\n'); fprintf(stdout, "You will play brown.\n\n"); fprintf(stdout, "Would you like to roll your own dice? "); - gets(s); + fgets(s, 100, stdin); putchar('\n'); if(*s == 'y') nobroll = 1; fprintf(stdout, "Would you like to go first? "); - gets(s); + fgets(s, 100, stdin); putchar('\n'); if(*s == 'y') goto nowhmove; @@ -141,7 +141,7 @@ nowhmove: retry: fprintf(stdout, "\nYour roll is %d %d\n", die1, die2); fprintf(stdout, "Move? "); - gets(s); + fgets(s, 100, stdin); switch(*s) { case '\0': /* empty line */ fprintf(stdout, "Brown's move skipped.\n"); @@ -362,7 +362,7 @@ roll(who) if(who == BROWN && nobroll) { fprintf(stdout, "Roll? "); - gets(s); + fgets(s, 10, stdin); n = sscanf(s, "%d%d", &die1, &die2); if(n != 2 || die1 < 1 || die1 > 6 || die2 < 1 || die2 > 6) fprintf(stdout, "Illegal - I'll do it!\n"); |