summaryrefslogtreecommitdiff
path: root/games/atc
AgeCommit message (Collapse)Author
2019-06-28When system calls indicate an error they return -1, not some arbitraryTheo de Raadt
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.
2017-07-09have bsd.prog.mk/bsd.lib.mk generate .y -> .c/.h rules without intermediateMarc Espie
files. This fixes up parallel builds in the default case. FreeBSD does something similar. okay millert@
2017-07-07we're not shooting yacceptionMarc Espie
okay millert@
2017-01-20Nuke some excess whitespace.Kenneth R Westerback
2016-12-01Remove useless #ifndef in atc(6) and pom(6).Frederic Cambus
M_PI is always defined, so we can drop those directives. OK deraadt@, millert@
2016-09-11Callers of time(3) should #include <time.h>.Theo Buehler
ok deraadt
2016-08-27Pull in <sys/time.h> for struct timespec, gettimeofday(), clock_gettime(),Philip Guenther
and setitimer() ok deraadt@
2016-03-16Prefer fseek(3) over rewind(3) since the latter although it also calls fseekmestre
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@
2016-03-07remove -u? from usage();Jason McIntyre
2016-03-07- General changes:mestre
- 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
2016-01-09ANSIfy grammar.y on atc(6), all other files already aremestre
OK tb@
2016-01-08add missing 'void'tb
ok mestre@
2016-01-07Some basic code maintenance in games/tb
- 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@
2016-01-03About 13 years ago when the idiom srandom(time()), and sometimesmestre
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@
2015-12-31Remove unused filemestre
Alerted by tb@
2015-12-31Include only needed header files per each source filemestre
OK tb@
2015-12-26Set as __dead a few more functions, that don't return, on games/mestre
With precious tip, help and also OK from tb@
2015-12-15Cleanup: pwd.h is no longer needed.tb
2015-12-15Replace 'arc4random() % range' by 'arc4random_uniform(range)'.tb
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@
2015-11-29adjust width list: Ds is unfortunate here;Jason McIntyre
2015-11-29Add pledge support and move score file to $HOME.tb
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.
2015-11-25Remove operations that "touch" scorefiles at install time.Theo de Raadt
2015-11-24In 1995, all of the games were setuid games. At end of 1996, I took them allTheo de Raadt
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
2015-11-20Convert hand-rolled option parsing to getopt(3).tb
ok deraadt@
2015-11-04replace setbuf with setvbuf, from Frederic NowakTed Unangst
2015-08-22remove malloc/calloc/realloc* casts, due to stdlib.h being present; ok ↵Theo de Raadt
millert krw
2015-02-18convert calloc/realloc pairs to reallocarrayTed Unangst
2014-12-09Do not memorialize cheaters in the high score file.Theo de Raadt
from pjanzen
2014-12-08For now, these games still contain deterministic randomization (forTheo de Raadt
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
2014-11-30Even though not callable, "Ed" is a macro name, so for clarity,Ingo Schwarze
escape it when it appears on a macro line.
2014-11-16Eliminate pointless use of <sys/param.h>, <sys/file.h>, <sys/sockio.h>,Philip Guenther
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@
2014-09-08obvious cases of missing .An;Ingo Schwarze
found with the new mandoc(1) MANDOCERR_AN_MISSING warning; no text changes
2014-07-13if not seeded explicitly, use arc4random instead. ok deraadtTed Unangst
2014-07-13long live BSD, SYSV is dead!Ted Unangst
2013-10-25start_time should be time_t, not int since it holds the reasult ofTodd C. Miller
time(0). OK guenther@
2009-10-28rcsid[] and sccsid[] and copyright[] are essentially unmaintained (andTheo de Raadt
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
2009-06-01Don't assume there will be a newline after calling fgets.Ray Lai
OK millert
2007-11-06fix format stringCharles Longeau
ok ray@ gilles@
2007-09-14remove some warnings:Charles Longeau
unused variable `variable' `variable' might be used uninitialized in this function ok gilles@ ray@
2007-09-11use strcspn to properly overwrite '\n' in fgets returned bufferGilles Chehade
ok pyr@, ray@, millert@, moritz@, chl@
2007-09-04Some more simple malloc(n * m) -> calloc(n, m) conversions.Hans-Joerg Hoexer
ok deraadt@
2007-05-31convert to new .Dd format;Jason McIntyre
2007-04-13when updating atc(6) to split the -f and -g flags in two optionsIgor Sobrado
I missed synchronizing the usage() function. problem noticed by jmc@
2007-04-13let -f and -g be in different options even if the argumentIgor Sobrado
names to both flags are the same. spotted by jmc@ with relation to other manual page. ok by jmc@
2007-04-02tidy up synopsis and usage(); from Igor SobradoJason McIntyre
2006-11-07make delayed turn commands not become immediate when there is aTheo de Raadt
request to go to the same altitude as already at. pr 3448
2006-11-02Check for valid character before truncating string.Ray Lai
Initial patch from Charles Longeau <chl at tuxfamily dot org>. OK moritz@.
2006-06-30use .y and .l in SRCS, remove hand-crafted CLEANFILES since this isOtto Moerbeek
now done by bsd.*.mk
2006-03-31fix number conversion logic; spotted by pat@; ok tedu@ pat@Otto Moerbeek
2006-03-27assorted fixes mostly from coverity via netbsd via jasper adriaanse via techTed Unangst