summaryrefslogtreecommitdiffstats
path: root/games/hack/hack.main.c
AgeCommit message (Collapse)AuthorFilesLines
2019-06-28When system calls indicate an error they return -1, not some arbitraryderaadt1-4/+4
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.
2019-04-05Fix hack(6).bentley1-2/+14
- Write savegames and scorefiles to the current directory instead of /var - Save oc_name and oc_descr alongside oc_uname in all situations - When a levitation potion times out, explicitly float down These patches were contributed last year by "tonypony76"; thanks! ok deraadt@, with added enthusiasm from tedu@
2016-01-09Remove several casts to (char *) 0 and replace them by NULLmestre1-2/+2
Prompted and OK by tb@
2016-01-09This diff is rather large, but it's just simply removing unnecessary headersmestre1-6/+6
, remove some lint-style comments, add missing void to functions without args, also some function prototypes (extern) were missing their args, so I added them as they were defined in hack.h OK tb@ on separate diffs
2016-01-07Some basic code maintenance in games/tb1-2/+2
- 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@
2015-12-16Use __progname instead of hand-rolled parsing of argv[0].tb1-4/+3
Inspired by similar diffs by tobias@ and millert@. "I like the concept" pjanzen@ ok tedu@
2015-11-04replace setbuf with setvbuf, from Frederic Nowaktedu1-2/+2
2015-09-27Annotate funcs with __attribute__((printf(...))) and clean up the fallout:guenther1-4/+4
* lots of foo(str) --> foo("%s", str) transformations * one totally insane foo(fmt, ap) --> vfoo(fmt, ap) conversion: how did this ever work? * prefer const char[] over char* for static format strings, as it lets gcc check the format and eliminates an unnecessary pointer ok beck@
2014-12-08For now, these games still contain deterministic randomization (forderaadt1-3/+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
2009-10-27rcsid[] and sccsid[] and copyright[] are essentially unmaintained (andderaadt1-5/+1
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
2005-05-01use setresgid() to drop privs, it is simply a better and less ambiguous API;djm1-5/+6
ok deraadt@ and millert@ a while ago, more to come
2003-07-06convert a bunch of strn{cpy,cat}->strl{cpy,cat}avsm1-15/+8
pjanzen@ ok
2003-05-19De-register, ANSIfy, clean up.pjanzen1-38/+44
2003-05-07Major strings rework. Ok pjanzen@tdeval1-8/+8
2003-04-062451 lines of strdup/sprintf/strcpy whacking. mostly ok'd by pjanzenderaadt1-4/+4
already, but he may have later changes to make still.
2003-03-16hack is freecamield1-3/+60
Thanks to Andries Brouwer, Jay Fenlason and the folks at CWI for their efforts. http://www.cwi.nl/~aeb/games/hack/hack.html ok deraadt@
2002-06-23uid_t and gid_t are unsignedderaadt1-3/+3
2001-01-28$OpenBSD$niklas1-1/+3
1999-08-16use O_* defines for open(2) flags and include fcntl.hmillert1-2/+2
1997-03-28Set umask so save files are writeable by hacktholo1-0/+1
1997-01-17r?index -> strr?chrmillert1-1/+1
1996-12-22proper gid revokederaadt1-2/+3
1996-10-26prefer $LOGNAME over $USER. fix strncpy() usage.millert1-5/+10
1995-10-18initial import of NetBSD treederaadt1-0/+504