summaryrefslogtreecommitdiff
path: root/games/worm/worm.c
AgeCommit message (Collapse)Author
2018-08-24Remove a few too early pledge(2)s on games/ and apply them a little bit laterRicardo Mestre
but with much reduced permissions ("stdio tty" if ncurses based and "stdio" for the ones that only perform basic operations). There's still a few games that we cannot yet remove their fs access, through pledge(2), since they open files on demand and too late, this might get revisited in the future. OK tb@
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-04More cleanup and sorting on header sectionmestre
OK tb@ and he also pointed out that for consistency with rest of the tree we should include termios.h instead of sys/ttydefaults.h, where applicable
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-26Set as __dead a few more functions, that don't return, on games/mestre
With precious tip, help and also OK from tb@
2015-11-21pledge the wyrmsTheo de Raadt
2015-11-04replace setbuf with setvbuf, from Frederic NowakTed Unangst
2015-08-26Replace clock_gettime UPTIME with MONOTONIC to improve worm portability.Rafael Zalamena
ok deraadt@, guenther@.
2015-08-24Fix cheating bug by using unused time variables and replace poll() withRafael Zalamena
ppoll() to better use the timespec struct. ok deraadt@.
2015-08-22remove malloc/calloc/realloc* casts, due to stdlib.h being present; ok ↵Theo de Raadt
millert krw
2015-08-21KNFTheo de Raadt
2015-03-09make the worm grow faster on larger terminals. this is more fun thanTed Unangst
starting with an enormous pile of worm at the start.
2014-11-03select() to poll() conversionsTheo de Raadt
ok tedu (... other games maintainer absent)
2014-01-28from pjanzen:Jason McIntyre
Start with the cursor on the worm's head. ok millert
2014-01-28from pjanzen:Jason McIntyre
Use strtonum() and error out on an unacceptable length argument rather than reverting to default values; document maximum initial length limit. started by a diff From: Jan Stary, who requested we document default behaviour ok millert
2013-08-29replace srandomdev()+random() with the arc4random*() familyChristian Weisgerber
tweaks and ok millert@, ok deraadt@
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
2004-11-29ansi. ok deraadt@Jonathan Gray
2003-06-03Remove the advertising clause in the UCB license which BerkeleyTodd C. Miller
rescinded 22 July 1999. Proofed by myself and Theo.
2003-05-19ANSIPaul Janzen
2003-05-19volatile sig_atomic_tPaul Janzen
2002-12-06Replace things like srandom(time(NULL)) with srandomdev(3). random(3)Todd C. Miller
good enough for games but we should at least use a decent seed. pjanzen@ OK
2002-05-31de-registerPaul Janzen
2002-05-31No dm -> no need to revoke setegid.Paul Janzen
2002-02-16Part one of userland __P removal. Done with a simple regexp with some minor ↵Todd C. Miller
hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be done automatically.
2001-11-17move gunk out of signal handlers, now safeTheo de Raadt
2001-09-03Handle EOF on stdin.Paul Janzen
2001-09-03Fixes from NetBSD (jsm@), one reported by Malcolm ParsonsPaul Janzen
<malcolm@ivywell.screaming.net>: don't hang if the worm occupies all the space, fix off-by-one, and check for screen size.
2001-02-18include <string.h>Paul Janzen
2000-01-25support arrow keys (cgd@netbsd.org); use select() rather than alarm() forPaul Janzen
timing
1999-09-03unbreak brakeHugh Graham
1999-04-20jsm28@cam.ac.uk: place cursor on player, not one over.Paul Janzen
1998-09-16Make sure malloc() succeedsPaul Janzen
1998-08-19tags, formatting, ANSI-fication, prototypes, de-typos, and the occasionalPaul Janzen
initialization, removal of unused variable, or other minor fix. Most changes are from or inspired by NetBSD.
1998-03-12OpenBSD ID (changed from NetBSD)Paul Janzen
1998-02-08cleanup; pjanzen@foatdi.harvard.eduTheo de Raadt
1996-12-22proper gid revokeTheo de Raadt
1996-12-19setgid games, not setuid games. closes a neat set of holesTheo de Raadt
1995-10-18initial import of NetBSD treeTheo de Raadt