summaryrefslogtreecommitdiffstats
path: root/tetris/scores.c
Commit message (Collapse)AuthorAgeFilesLines
* games: remove trailing whitespace in *.c and *.hrillig2021-05-051-2/+2
|
* Get all the games compiling for iOSCameron Katri2021-02-221-5/+7
|
* avoid uninit memory and use memmove vs strncpy for a will bemrg2020-09-071-3/+3
| | | truncated on purpose string.
* fix the previous. the code was right, just badly formatted before.mrg2018-06-241-4/+3
| | | should fix infinite loops reported in some cases.
* fix issues found by GCC 6.4:mrg2018-02-041-2/+3
| | | | | | | | | | | | | | | | | battlestar was missing some {} in its insane printf()+puts() usage. this is a literal code sequence i found: printf("The blast catches "); printf("the goddess in the "); printf("stomach, knocking "); puts("her to the ground."); printf("She writhes in the "); printf("dirt as the agony of "); puts("death taunts her."); puts("She has stopped moving."); no lines inserted or removed. tetris' checkscores() had wrong and missing {} usage.
* Revert part of previous -r1.21 and fix the errno-handling bug instead.dholland2014-03-221-1/+4
|
* fix unused variable warningschristos2013-10-191-5/+2
|
* Fix fd leak in error cases. Found by cppcheck.wiz2011-01-051-12/+12
|
* Userland now builds and uses terminfo instead of termcap.roy2010-02-031-5/+5
| | | OK: core@, jdc@
* Disable writing scores when built for /rescue. PR 42009dholland2009-09-081-2/+18
|
* Don't use a variable-size array here. There's not really that much point.dholland2009-06-011-2/+2
|
* Clean up scorefile handling.dholland2009-05-251-35/+520
| | | | | | | | | | | | | | | | | | | | | | This was writing time_t to disk. Worse, the time_t member was at an unaligned offset in the structure in question, so after the time_t change the structure layout depended on compiler-inserted structure padding. This gives three legacy formats: one with 32-bit time, one with 64-bit time, and one with 64-bit time and 4 bytes of structure padding. And of course the file didn't have a header or version coding or anything. The new code writes a structure of well-defined size that should not receive unexpected padding, and gives the file a header and version number. It reads that format and any of the three legacy formats, figuring out which one it's dealing with by inspecting the file contents. For good measure, it also now handles opposite-endian files, doesn't bail out unceremoniously unless necessary, and won't croak if the file is corrupt and e.g. contains unterminated strings. (Was it worth going to this length? Maybe not. But it didn't seem right to just leave it, and it's not clear where to stop halfway.)
* ANSIfy function declarations.dholland2009-05-251-18/+8
| | | | | Some object file diffs, but they are harmless. (Mostly they seem to come from internal counters in gcc... and in one case the order of two instructions was harmlessly swapped, which is odd and annoying.)
* Better check data read from tetris.scores before use as array indices etc.drochner2006-06-011-9/+12
| | | | | | This is CVE-2006-1539, files against Gentoo Linux, the patch is from Gentoo. A standard NetBSD installation is not as much risk because tetris is sgid "games", and users shouldn't be in that group.
* Remove uses of __P.jsm2004-01-271-6/+6
|
* Move UCB-licensed code from 4-clause to 3-clause licence.agc2003-08-071-6/+2
| | | Patches provided by Joel Baker in PR 22269, verified by myself.
* de-registerwiz2002-06-021-17/+17
|
* Clean up error reporting in tetris.jsm2000-01-211-2/+2
|
* Fix high score table formatting bug.jsm2000-01-211-3/+2
| | | Bug report and fix from Malcolm Parsons <malcolm@bits.bris.ac.uk>.
* Fix -Wsign-compare warnings.jsm1999-09-181-2/+2
|
* Convert tetris to use <err.h> functions.jsm1999-09-171-15/+8
|
* Security improvements for games (largely from or inspired by OpenBSD).jsm1999-09-121-1/+8
| | | | | | | | | | | | | | | Games which run setgid from dm, but don't need to, should drop their privileges at startup. Games which have a scorefile should open it at startup, then drop all privileges leaving just the open writable file descriptor. If the game can invoke subprocesses, this should be made close-on-exec. Games with scorefiles should make sure they do not get a file descriptor < 3. (Otherwise, they could get confused and corrupt the scorefile when using stdin, stdout or stderr.) Some old setuid revokes from the days of setuid games change into gid revokes.
* Add use of `const' where appropriate to the games.jsm1999-09-081-2/+2
| | | | | | | | | This merges in all such remaining changes from the Linux port of the NetBSD games, except in hunt (where substantial changes from OpenBSD need to be looked at). Some such changes were previously covered in PRs bin/6041, bin/6146, bin/6148, bin/6150, bin/6151, bin/6580, bin/6660, bin/7993, bin/7994, bin/8039, bin/8057 and bin/8093.
* use <termcap.h>lukem1997-10-141-6/+2
|
* bfunctions -> memfunctionstls1997-01-131-2/+2
|
* NetBSD RCS Idscgd1995-04-221-0/+2
|
* ascii tetris!cgd1994-05-061-0/+472