Commit Graph

74 Commits

Author SHA1 Message Date
dholland 0f960348b2 Pass -Wstrict-overflow, and while here, don't read from index -1 of
an array.
2012-10-13 20:36:06 +00:00
plunky acae68523e reinstate NULL cast by request, where the NULL was being passed as a vararg 2011-09-01 07:18:50 +00:00
plunky 9f61b80465 NULL does not need a cast 2011-08-31 16:24:54 +00:00
dholland ae56ae8f3f Use __dead and __printflike instead of __attribute__. 2011-08-26 06:18:16 +00:00
joerg 76266ce815 Don't use variables as format strings. 2011-05-23 22:48:52 +00:00
joerg 278b576ff4 ANSIfy 2011-05-23 22:47: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 e0ba63fe83 sprinkle static 2009-08-12 05:48:04 +00:00
roy 7027866a09 Rename internal getline() function to get_line() so it does
conflict with the soon to be added getline(3) libc function.
2009-07-13 19:05:39 +00:00
dholland 54163608bb sprintf -> snprintf 2009-06-04 04:48:04 +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
ragge 4d90c6e639 __attribute -> __attribute__ 2007-09-16 18:39:54 +00:00
rtr 90b0b10c77 remove duplicate #include <stdlib.h> 2006-03-20 12:32:21 +00:00
he 3ac2299da5 Now that we use exit(2), we need to include <stdlib.h> for its definition. 2006-03-19 12:09:39 +00:00
christos c08f926ecb include <stdlib.h> to get a prototype for exit 2006-03-19 06:02:50 +00:00
christos 2a67d42737 Coverity CID 1295: Don't allow cchose to return a negative number. It is
used as an index.
2006-03-18 23:14:45 +00:00
jmc 1f90022eca KNF and WARNS=3 2005-07-02 08:32:32 +00:00
rillig 117d073a60 Fixed wrong use of datatypes. In wait_for(), a char was used together
with getchar(), in readchar(), a char was used to read input, which in
getuchar() is used as an argument to islower() and toupper(). Also removed
a condition which terminated the process if the user typed in character
255. Approved by christos.
2005-04-19 20:12:07 +00:00
jsm b91a81ab9f Cast last argument of execl to (char *).
Reviewed by <hubertf>.
2005-02-15 12:56:20 +00:00
dsl 49f7d8a9b1 Add (unsigned char) cast to ctype functions 2004-11-05 21:30:31 +00:00
jsm 10b61a7cca Mark unused parameters, nonreturning functions and format functions in
the few cases not already marked.
2004-02-08 22:23:50 +00:00
jsm cb5fd8342e Remove uses of __P. 2004-01-27 20:30:28 +00:00
jsm d8c5384694 Rename rint to receive_intr to avoid conflict with GCC 3.4 built-in C99
function.
2004-01-26 09:58:35 +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
thorpej 15edfc1544 Avoid confict with reserved identifier "expl". 2002-12-06 01:48:24 +00:00
wiz afcfd8817a n-dashes are even better here. Noted by Robert Elz. 2002-09-30 12:43:22 +00:00
wiz c91d8d6b9b Lots of minor fixes resulting from reading these man pages in detail. 2002-09-26 18:31:58 +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
wiz 7fd8f3df3f __STDC__ is always defined on NetBSD. 2002-05-26 00:12:11 +00:00
blymn 7d6d5f042f Change deprecated curses function to new equivalent. 2001-12-06 11:59:45 +00:00
blymn c08523b03e Replace deprecated curses call with supported equivalent. 2001-12-04 13:12:23 +00:00
wiz 834bb1b3ab Whitespace and/or punctuation fixes. 2001-04-02 22:42:37 +00:00
christos b176d7de54 remove redundant decl 2001-02-05 00:28:30 +00:00
mycroft f9eca6973d Use setgid(), not setregid(). 2000-05-08 07:55:59 +00:00
drochner 85cbf55d16 Since our gcc doesn't warn about NULL format strings anymore, we can
fix the incorrect err(1, "%s", "") et al.
Closes PR bin/7592 by cgd.
1999-11-09 15:06:30 +00:00
jsm 04e5e8fff9 Add more files to FILES section of cribbage.6. 1999-10-01 17:04:42 +00:00
jsm ce5670f70f Fix uses of namespaces reserved by ISO C or POSIX.1. 1999-09-30 18:01:31 +00:00
jsm d615d2a90e Define variables as BOOLEAN, not bool, where the extern declarations
already use BOOLEAN.
1999-09-19 18:12:09 +00:00
jsm 20e3305006 Fix -Wsign-compare warnings. 1999-09-18 19:38:46 +00:00
jsm 533a40974d Make cribbage use the POSIX.2 pager behaviour. 1999-09-13 17:27:36 +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 271baf14b4 Fix glitch in const changes (bin/8365 from John.P.Darrow@wheaton.edu). 1999-09-10 00:03:14 +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
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
lukem b569ddabe9 don't install in /usr/share if NOSHARE is defined 1998-09-29 07:33:20 +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
veego 04afeca685 Add braces to make the new egcs happy. 1998-08-30 09:19:36 +00:00