summaryrefslogtreecommitdiffstats
path: root/games/atc (follow)
Commit message (Collapse)AuthorAgeFilesLines
* fix unmarked/ignored descriptive mix up;jmc2020-12-131-5/+5
| | | | from rafa
* When system calls indicate an error they return -1, not some arbitraryderaadt2019-06-281-3/+3
| | | | | | value < 0. errno is only updated in this case. Change all (most?) callers of syscalls to follow this better, and let's see if this strictness helps us in the future.
* have bsd.prog.mk/bsd.lib.mk generate .y -> .c/.h rules without intermediateespie2017-07-091-2/+2
| | | | | | | files. This fixes up parallel builds in the default case. FreeBSD does something similar. okay millert@
* we're not shooting yacceptionespie2017-07-071-2/+1
| | | | okay millert@
* Nuke some excess whitespace.krw2017-01-201-4/+4
|
* Remove useless #ifndef in atc(6) and pom(6).fcambus2016-12-011-5/+1
| | | | | | M_PI is always defined, so we can drop those directives. OK deraadt@, millert@
* Callers of time(3) should #include <time.h>.tb2016-09-112-2/+4
| | | | ok deraadt
* Pull in <sys/time.h> for struct timespec, gettimeofday(), clock_gettime(),guenther2016-08-271-1/+2
| | | | | | and setitimer() ok deraadt@
* Prefer fseek(3) over rewind(3) since the latter although it also calls fseekmestre2016-03-161-3/+5
| | | | | | | then additionally it calls clearerr(3) deliberately but we want to catch any error that may happen and this way we couldn't catch it OK tb@
* remove -u? from usage();jmc2016-03-071-2/+2
|
* - General changes:mestre2016-03-072-12/+6
| | | | | | | | | | | | - Remove -? from getopt(3) options, but still keep (or add) -h where applicable - Replace hardcoded program strings by getprogname(3) - Specific changes: - atc(6): this used -? and -u for usage(), remove both from game and manpage - bcd(6): use __progname instead of getprogname(3), no need to include stdlib.h - hunt(6): replace fputs(3) by fprintf(3) OK tb@ after his suggestions
* ANSIfy grammar.y on atc(6), all other files already aremestre2016-01-091-15/+8
| | | | OK tb@
* add missing 'void'tb2016-01-082-4/+4
| | | | ok mestre@
* Some basic code maintenance in games/tb2016-01-071-3/+3
| | | | | | | | | | - in main() replace exit with return - drop some /* NOTREACHED */ lint comments along the way. - make more use of standard CFLAGS, esp. -Wimplicit-function-declaration - add and sort some headers when needed - add straightforward pledges to some programs used at compile time discussed with and ok mestre@
* About 13 years ago when the idiom srandom(time()), and sometimesmestre2016-01-031-2/+1
| | | | | | | | | | | | srandom(time()+getpid()), was changed by srandomdev(), but #include <time.h> lived up until this day so remove it. Additionally, earlier than that, 18 years ago, random(6) was one of the first consumers of arc4random(3) family, and was pulling it from dev/rndvar.h but these days we pull it from stdlib.h, which is already done, so while here remove dev/rndvar.h also. "seems comprehensive to me" deraadt@ and OK tb@
* Remove unused filemestre2015-12-311-0/+0
| | | | Alerted by tb@
* Include only needed header files per each source filemestre2015-12-3111-88/+65
| | | | OK tb@
* Set as __dead a few more functions, that don't return, on games/mestre2015-12-261-3/+3
| | | | With precious tip, help and also OK from tb@
* Cleanup: pwd.h is no longer needed.tb2015-12-151-2/+1
|
* Replace 'arc4random() % range' by 'arc4random_uniform(range)'.tb2015-12-151-5/+14
| | | | | | | | | | Do this by introducing atcrandom_uniform(range) which returns deterministic randomness or good randomness depending on whether a seed was specified with the -r option. Diff by Matthew Martin, reviewed by deraadt@ and me. ok deraadt@
* adjust width list: Ds is unfortunate here;jmc2015-11-291-2/+2
|
* Add pledge support and move score file to $HOME.tb2015-11-294-33/+40
| | | | | | | For high score entries use the same logic as in snake(6) and tetris(6): Try LOGNAME then USER then getlogin(2) and fall back to ???. For variety, atc(6) uses flock(2), so add a "flock" promise to the usual "stdio rpath rpath cpath tty" for games.
* Remove operations that "touch" scorefiles at install time.deraadt2015-11-251-7/+1
|
* In 1995, all of the games were setuid games. At end of 1996, I took them allderaadt2015-11-241-2/+1
| | | | | | | | | to setgid games, and we started wittling them down. Nearly 10 years later I am removing all setgid from the games. If any of these have score files they are now broken, and I hope various folk repair them. I have argued for years (and received pushback...) that the score file features must be removed, or rewritten to use private files, because setgid is the wrong tool. ok tedu
* Convert hand-rolled option parsing to getopt(3).tb2015-11-201-46/+37
| | | | ok deraadt@
* replace setbuf with setvbuf, from Frederic Nowaktedu2015-11-041-2/+2
|
* remove malloc/calloc/realloc* casts, due to stdlib.h being present; ok millert krwderaadt2015-08-221-2/+2
|
* convert calloc/realloc pairs to reallocarraytedu2015-02-181-29/+13
|
* Do not memorialize cheaters in the high score file.deraadt2014-12-094-8/+9
| | | | from pjanzen
* For now, these games still contain deterministic randomization (forderaadt2014-12-081-2/+2
| | | | | | | save / replay modes of operation that have not yet been cleaned up). OK, I've let the cat out of the bag, now some of you know you can cheat at them.. ok millert guenther tedu
* Even though not callable, "Ed" is a macro name, so for clarity,schwarze2014-11-301-3/+3
| | | | escape it when it appears on a macro line.
* Eliminate pointless use of <sys/param.h>, <sys/file.h>, <sys/sockio.h>,guenther2014-11-162-5/+4
| | | | | | | | | and <sys/ttydefaults.h> Replace MAXPATHLEN with PATH_MAX and MAXLOGNAME with LOGIN_NAME_MAX Pull in <limits.h> where needed Prefer sizeof(var) over MAXFOO or FOO_MAX ok deraadt@
* obvious cases of missing .An;schwarze2014-09-081-3/+7
| | | | | found with the new mandoc(1) MANDOCERR_AN_MISSING warning; no text changes
* if not seeded explicitly, use arc4random instead. ok deraadttedu2014-07-133-10/+26
|
* long live BSD, SYSV is dead!tedu2014-07-134-73/+6
|
* start_time should be time_t, not int since it holds the reasult ofmillert2013-10-252-4/+8
| | | | time(0). OK guenther@
* rcsid[] and sccsid[] and copyright[] are essentially unmaintained (andderaadt2009-10-279-87/+9
| | | | | | | unmaintainable). these days, people use source. these id's do not provide any benefit, and do hurt the small install media (the 33,000 line diff is essentially mechanical) ok with the idea millert, ok dms
* Don't assume there will be a newline after calling fgets.ray2009-06-011-3/+4
| | | | OK millert
* fix format stringchl2007-11-061-3/+3
| | | | ok ray@ gilles@
* remove some warnings:chl2007-09-141-5/+3
| | | | | | | unused variable `variable' `variable' might be used uninitialized in this function ok gilles@ ray@
* use strcspn to properly overwrite '\n' in fgets returned buffergilles2007-09-111-6/+5
| | | | ok pyr@, ray@, millert@, moritz@, chl@
* Some more simple malloc(n * m) -> calloc(n, m) conversions.hshoexer2007-09-041-10/+10
| | | | ok deraadt@
* convert to new .Dd format;jmc2007-05-311-2/+2
|
* when updating atc(6) to split the -f and -g flags in two optionssobrado2007-04-131-4/+4
| | | | | | I missed synchronizing the usage() function. problem noticed by jmc@
* let -f and -g be in different options even if the argumentsobrado2007-04-131-2/+3
| | | | | | | | names to both flags are the same. spotted by jmc@ with relation to other manual page. ok by jmc@
* tidy up synopsis and usage(); from Igor Sobradojmc2007-04-022-10/+11
|
* make delayed turn commands not become immediate when there is aderaadt2006-11-071-6/+14
| | | | request to go to the same altitude as already at. pr 3448
* Check for valid character before truncating string.ray2006-11-021-6/+13
| | | | | | Initial patch from Charles Longeau <chl at tuxfamily dot org>. OK moritz@.
* use .y and .l in SRCS, remove hand-crafted CLEANFILES since this isotto2006-06-301-3/+2
| | | | now done by bsd.*.mk
* fix number conversion logic; spotted by pat@; ok tedu@ pat@otto2006-03-311-6/+6
|