diff options
author | Eivind Eklund <eivind@FreeBSD.org> | 1997-02-20 03:04:54 +0000 |
---|---|---|
committer | Eivind Eklund <eivind@FreeBSD.org> | 1997-02-20 03:04:54 +0000 |
commit | c52e467e03e623e6ca9fc3f592b7d146cd6486da (patch) | |
tree | c09c18b60a67afd2e34d5a6138c86fe56288b8e3 /games/battlestar/cypher.c | |
parent | 2745e1ab7e462628c782bc37ceee0b85b4d8d991 (diff) | |
download | src-c52e467e03e623e6ca9fc3f592b7d146cd6486da.tar.gz src-c52e467e03e623e6ca9fc3f592b7d146cd6486da.zip |
Remove buffer overflow and tempfile race, remove <sys/time.h> hack (and
need for it), change definition of setbit() macro and friends to be
compatible with <sys/param.h>.
The bugs were discovered and fixed as a result of the FreeBSD code audit.
Submitted by: Aaron Bornstein <aaronb@j51.com>, Mark Huizer <xaa@stack.nl>
Notes
Notes:
svn path=/head/; revision=22939
Diffstat (limited to 'games/battlestar/cypher.c')
-rw-r--r-- | games/battlestar/cypher.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/games/battlestar/cypher.c b/games/battlestar/cypher.c index ec02a796e6ad..ff5da4eebc8e 100644 --- a/games/battlestar/cypher.c +++ b/games/battlestar/cypher.c @@ -283,10 +283,10 @@ cypher() fgets(buffer,10,stdin); if (*buffer != '\n') sscanf(buffer,"%d", &position); - printf("Time (was %d) = ",time); + printf("Time (was %d) = ",gtime); fgets(buffer,10,stdin); if (*buffer != '\n') - sscanf(buffer,"%d", &time); + sscanf(buffer,"%d", >ime); printf("Fuel (was %d) = ",fuel); fgets(buffer,10,stdin); if (*buffer != '\n') @@ -303,10 +303,10 @@ cypher() fgets(buffer,10,stdin); if (*buffer != '\n') sscanf(buffer,"%d",&WEIGHT); - printf("Clock (was %d) = ",clock); + printf("Clock (was %d) = ",gclock); fgets(buffer,10,stdin); if (*buffer != '\n') - sscanf(buffer,"%d",&clock); + sscanf(buffer,"%d",&gclock); printf("Wizard (was %d, %d) = ",wiz, tempwiz); fgets(buffer,10,stdin); if (*buffer != '\n'){ @@ -324,7 +324,7 @@ cypher() case SCORE: printf("\tPLEASURE\tPOWER\t\tEGO\n"); printf("\t%3d\t\t%3d\t\t%3d\n\n",pleasure,power,ego); - printf("This gives you the rating of %s in %d turns.\n",rate(),time); + printf("This gives you the rating of %s in %d turns.\n",rate(),gtime); printf("You have visited %d out of %d rooms this run (%d%%).\n",card(beenthere,NUMOFROOMS),NUMOFROOMS,card(beenthere,NUMOFROOMS)*100/NUMOFROOMS); break; |