Commit Graph

68 Commits

Author SHA1 Message Date
kre dabfbe63eb Adapt to recent change to ../snake/pathnames.h 2021-05-12 15:26:44 +00:00
nia 7570066346 snake: Avoid creating definitions prefixed with _ inside a program 2021-05-12 11:08:31 +00:00
msaitoh 8012ca3f0e Remove extra semicolon. 2020-05-14 08:34:17 +00:00
dholland cbe436060d Do not pass usleep() values >= 1 million. From Henning Petersen in PR 51286 2016-06-27 08:46:04 +00:00
dholland d548b4af6b snake(6) supports LCD displays too. (noted by tnn) 2016-03-12 03:13:52 +00:00
dholland 277bd0756c WARNS=5, and make WARNS=5 the default for src/games. 2012-06-19 05:46:08 +00:00
pgoyette 6688046702 Fix a few of the games to use getprogname() in their usage() functions.
Suggested by Joerg.

XXX There are probably many more that have their progname hard-coded, but
XXX I'm not up for a wholesale roto-till at the moment.
2010-12-05 04:34:22 +00:00
he 76d4444c78 When using -lcurses, you also need -lterminfo.
This fixes the build for sun2, and also builds with LDSTATIC=-static,
since archive libraries don't record inter-library dependencies.
2010-02-06 23:45:24 +00:00
dholland 1e99780e5d sprinkle static 2009-08-12 08:44:45 +00:00
joerg a62737a7d9 Remove redundant .br 2009-03-11 13:05:59 +00:00
drochner 432ec04420 if initscr() fails, exit with a message rather than crash in the
next curses call
2008-08-08 16:10:47 +00:00
lukem 2fe2731d3f Remove the \n and tabs from the __COPYRIGHT() strings. 2008-07-20 00:52:39 +00:00
perry 8b0f9554ff convert __attribute__s to applicable cdefs.h macros 2007-12-15 19:44:37 +00:00
hubertf 61daec5724 Replve duplicate #includes
From Slava Semushin <slava.semushin@gmail.com>, via private mail
2007-01-17 00:30:23 +00:00
abs 2c2c60a0ef if getpwuid() returns null, print out the uid rather than dereferencing
Addresses Coverity CID 930
2006-03-17 23:22:59 +00:00
abs f0ff12503e Fix overrun in players[] array. Addresses Coverty CID 1457 2006-03-17 23:15:02 +00:00
jsm 859993b44f Control -d by #ifdef DEBUG; adjust usage message accordingly. Bug
reported by Malcolm Parsons <malcolm@ivywell.screaming.net> in Debian
bug 84852.
2004-02-08 00:33:31 +00:00
jsm cb5fd8342e Remove uses of __P. 2004-01-27 20:30:28 +00:00
agc e5aeb4ea46 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22269, verified by myself.
2003-08-07 09:36:50 +00:00
wiz 0d22e30cd0 New sentences begin on new lines.
Patch from Richard Elz, slightly improved by yours truly.
2002-09-26 16:12:39 +00:00
lukem bcf4617b61 some makefile de-linting 2002-09-18 06:16:39 +00:00
tv a2291b79c0 MKfoo=no -> NOfoo= 2001-12-12 00:07:45 +00:00
jsm 488fd227b8 Always lseek back to the beginning of the file in post(), which may be
called twice in a game if a bonus occurs.  Patch from Malcolm Parsons
<malcolm@ivywell.screaming.net>.
2001-08-31 07:17:02 +00:00
wiz 8a84240a6e Whitespace and/or punctuation fixes. 2001-04-02 22:47:29 +00:00
mycroft f9eca6973d Use setgid(), not setregid(). 2000-05-08 07:55:59 +00:00
jsm d8d956c46c Improve snscore error handling. 2000-01-21 00:27:03 +00:00
cgd adefe1f0dd fix handling of '-t' flag, and pause for a little bit after drawing happysnake 1999-10-26 06:38:31 +00:00
cgd f55171028e correct description of representation of snake 1999-10-26 06:36:53 +00:00
jsm ddc89b7f91 Convert snake to use curses, and generally clean it up somewhat.
Includes bugfixes from or inspired by OpenBSD.
1999-09-14 18:07:21 +00:00
jsm 5367f3400c Security improvements for games (largely from or inspired by OpenBSD).
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.
1999-09-12 09:02:20 +00:00
jsm a9c7f9b096 Check for failure of malloc() and calloc() at various places in the games. 1999-09-09 17:27:58 +00:00
jsm 5fb18dd9da Use the symbolic names `SEEK_SET' and `O_RDONLY' where appropriate in
the games.
1999-09-08 21:57:16 +00:00
jsm b03d4fa882 Add `__noreturn__' and `__unused__' attributes where appropriate to
the games.

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).

Most noreturn attributes were previously added in bin/6144, with some
others that were missed then in bin/8082.  Previous `unused'
attributes were covered in bin/6557, bin/8058 and other PRs (all these
PRs have already been handled and closed).
1999-09-08 21:45:25 +00:00
jsm 092d313019 Add use of `const' where appropriate to the games.
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.
1999-09-08 21:17:44 +00:00
tron 7cef41650e Adapt to change of "termcap.h". 1999-08-14 16:38:45 +00:00
lukem dcab0210a0 convert from NOxxx= to MKxxx=no.
include <bsd.own.mk> if testing a MKxxx variable.
1999-02-13 02:54:17 +00:00
hubertf 1c9494f62b mark non-returning functions (PR#6144 by Joseph Myers <jsm28@cam.ac.uk>) 1998-09-13 15:27:25 +00:00
hubertf 9a9bb90e33 fix main() prototype, per PR#5867 1998-09-11 14:25:22 +00:00
mycroft a6bb9f4ef1 const poisoning. 1998-07-27 01:12:35 +00:00
christos 1af8810050 Remove -lcompat; not needed. 1998-02-04 10:24:13 +00:00
mrg 6074e1b476 install games that need it setgid. 1997-11-20 00:12:30 +00:00
lukem 10d5d0d9ce use CPPFLAGS instead of CFLAGS 1997-10-22 05:26:25 +00:00
lukem 0dc4ed53f0 use <termcap.h> 1997-10-14 01:02:48 +00:00
lukem 2d3e71aa25 WARNSify, KNFify 1997-10-12 01:49:24 +00:00
chopps 78bf5c48e8 BS was using obsolete 'bs' and 'bc' capabilities. Now tries 'le' first.
This deals with pr#2417
1996-07-03 04:17:24 +00:00
pk 8910e3276d Avoid NULL-pointer deref and for now, simply exit if required terminal
capabilities aren't there. Since the capabilities in question are marked
`obsolete' in termcap(5), someone might want to have another look
at this someday (PR#2417).
1996-05-19 20:22:09 +00:00
mycroft 3bcff74505 Fix usages of ospeed. 1995-04-29 01:17:12 +00:00
mycroft 0033744bda Use POSIX tty semantics. 1995-04-29 00:06:37 +00:00
cgd c4816c32b3 Various changes to make games compile w/o warnings on the alpha:
Include appropriate includes, delete bogus function declarations,
change sizes of variables and casts.
1995-04-24 12:21:37 +00:00
cgd f27050860d fix up botched include 1995-04-22 10:18:17 +00:00