Commit Graph

144 Commits

Author SHA1 Message Date
dholland a627b0395f Build with WARNS=4. Sort out the game's shadowing of its own variables,
which fixes at least one bug.
2008-01-28 01:58:01 +00:00
perry 8b0f9554ff convert __attribute__s to applicable cdefs.h macros 2007-12-15 19:44:37 +00:00
mrg 06b50ed8b9 don't try to switch a char and have a case of EOF - use an int. 2006-05-18 18:42:59 +00:00
drochner d8da09bdaf fix buffer overflow (CVE-2006-1744), from Debian 2006-04-20 10:57:26 +00:00
christos 2197ff9156 Coverity CID 980: Prevent an impossible NULL point deref. 2006-03-19 00:41:46 +00:00
abs a3edf3e145 If none of the boarding parties are set do not fall off the end of the
list. Addresses Coverity CID 1507. Also put pointers before shorts in
a struct rather than mixing them up
2006-03-18 01:43:52 +00:00
wiz d9f5a9df01 Use standard AUTHORS section header. From YOMURA Masanori in private mail
Sort sections if necessary. Use more/better markup.
2005-09-15 02:09:41 +00:00
dsl 49f7d8a9b1 Add (unsigned char) cast to ctype functions 2004-11-05 21:30:31 +00:00
jrf 190b2e4c51 Replaced strncpy with strlcpy. Thanks to Peter Postma who
pointed them our in PR #25762. Approved by christos@NetBSD.org.
2004-09-07 13:20:39 +00:00
jsm 5c6ba47786 Use standard C abs function rather than local macro. 2004-02-08 00:32:48 +00:00
jsm 716c7169f3 Include <sys/stat.h>. 2004-01-27 20:27:59 +00:00
jsm 8f5e2162b1 Include <sys/types.h>. 2004-01-27 20:27:29 +00:00
jsm a5f914a25a Use int for wait status. 2004-01-27 20:23:36 +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 8ad24861a6 PDP-11 instead of PDP 11. Igor Sobrado in PR 19678. 2003-03-30 20:53:30 +00:00
wiz 904b6b9402 Mdoc nits -- unneeded ". 2002-09-26 16:33:53 +00:00
wiz 875690e96c Ispell. 2002-09-26 16:29:25 +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
ross dc5571b22e Generate <>& symbolically. I'm avoiding .../dist/... directories for now. 2002-02-08 01:21:55 +00:00
blymn b9c3526a19 Changed deprecated curses call to new equivalent. 2001-12-06 12:21:00 +00:00
wiz 4c99916337 va_{start,end} audit:
Make sure that each va_start has one and only one matching va_end,
especially in error cases.
If the va_list is used multiple times, do multiple va_starts/va_ends.
If a function gets va_list as argument, don't let it use va_end (since
it's the callers responsibility).

Improved by comments from enami and christos -- thanks!

Heimdal/krb4/KAME changes already fed back, rest to follow.

Inspired by, but not not based on, OpenBSD.
2001-09-24 13:22:25 +00:00
jsm 312e8e64e5 Include <time.h> for declarations the Single Unix Specification says
are there but not in <sys/time.h>.
2001-08-29 18:23:44 +00:00
wiz 834bb1b3ab Whitespace and/or punctuation fixes. 2001-04-02 22:42:37 +00:00
christos dc6488eb8e remove redundant decls. 2001-02-05 01:10:08 +00:00
cgd bcc8ec9959 include stdlib.h for prototypes (typically for exit()). 2001-01-16 02:44:43 +00:00
itojun 7fde9b10c9 need string.h for prototype (checked with alpha) 2001-01-04 06:33:18 +00:00
jwise a5f75468c7 Normalize signature of ship handling functions -- struct ship * from and
struct ship * to are now always the first two args.
2001-01-04 06:16:51 +00:00
jwise d62e34ecca Various stylistic nits. 2001-01-04 05:34:56 +00:00
jwise cf3f63cd97 Use License templates from localsrc for license on new files. 2001-01-04 05:06:15 +00:00
jwise 9baf035b4e Break out curses display-related globals into a new header file, so that
<curses.h> doesn't have to be included all over the place.
2001-01-04 04:41:41 +00:00
jwise 61a39e0b38 More rationalization of include files:
a.) Don't include a zillion system headers from "extern.h" (actually, don't
    include any).
b.) Break a global jmp_buf variable into a new file, so <setjmp.h> doesn't
    have to be pulled in everywhere (it's only used in two places).

The (one line) new file is (c) TNF with a three-clause license, FW(L)IW.
2001-01-04 03:51:23 +00:00
jwise aac077fce8 Rationalize inclusion of header files: cut down on `include everything
everywhere' a little (more to go), and as per KNF, local includes after
system includes.
2001-01-04 03:21:16 +00:00
jwise 43894be666 Second half of static-ization of local funcs. 2001-01-04 02:43:32 +00:00
jwise d5c5fed0c7 G/C undocumented and unimplemented `-D' (debug) option. 2001-01-04 01:56:27 +00:00
jwise bca097d567 First half of static-ization of local funcs. 2001-01-04 01:53:24 +00:00
jwise a6dfac213f De-`register' 2001-01-04 01:13:34 +00:00
jwise 3ad2426f33 Fix getopt usage (again) in case where user does not choose a scenario on
the command line.
2001-01-01 22:33:01 +00:00
jwise fdb512d4b5 Missed commit -- ANSIfy in preparation for further work. 2001-01-01 22:23:29 +00:00
jwise e6d2cd0771 Fix getopt() usage. 2001-01-01 22:05:04 +00:00
jwise dfea9f08db ANSIfy in preparation for further work. 2001-01-01 21:57:37 +00:00
jwise 8ebca10bc2 Fix warning. 2000-11-30 22:07:24 +00:00
jwise 3e7481b12e Use random() instead of rand(), and seed from time(3) instead of from getpid(). 2000-11-30 22:06:04 +00:00
jwise 48253ebcef Change the macro to roll a six-sided die from die() to dieroll() (for
obvious reasons of convention).
2000-11-30 22:02:20 +00:00
jwise f876814eec ANSIfy in preparation for changes. 2000-11-30 21:50:58 +00:00
jwise 91d3d6a540 Use getopt(3) for flag processing. 2000-11-30 21:38:57 +00:00
jwise 65d4c9fc15 Fix style nit. 2000-11-30 21:31:33 +00:00
jwise ed516eb73f ANSIfy in preparation for other changes. 2000-11-30 21:29:32 +00:00
matt 3233065035 More include additions for exit, abs, strcmp, etc. 2000-07-03 03:57:39 +00:00
mycroft 72e0a45036 Don't make /var/games/sail here. 2000-06-11 15:37:51 +00:00
itojun 687e7b9dbd avoid failure on "make install" when /var/games/sail already exists. 2000-02-12 10:03:30 +00:00
jsm 01be126759 Fix insecure /tmp usage in sail.
Essentially concludes the merge into NetBSD of those changes in the
Linux port of the NetBSD games which it is fairly clear to me should
be so merged.
2000-02-09 22:27:55 +00:00
jsm e788ff0231 Don't initialise curses until after the initial non-curses setup (the
choice of scenario uses puts() rather than curses functions).
2000-01-31 11:08:53 +00:00
jsm 73479d22b8 Use separate definitions and extern declarations of variables rather
than linker commons.
1999-12-28 18:05:24 +00:00
jsm ce5670f70f Fix uses of namespaces reserved by ISO C or POSIX.1. 1999-09-30 18:01:31 +00:00
jsm ba40c8d63d Fix some uses of NULL as non-pointer and 0 for null pointer. 1999-09-17 17:07:11 +00:00
jsm 2b25de3a90 Include <time.h> in various places in the games where time() or time_t
are used.
1999-09-09 17:30:17 +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
simonb a2ed16d0dd initscr() returns a pointer, compare return value with NULL and not
an int.
Compatible with other versions of curses.
1999-04-18 03:30:12 +00:00
hubertf 24f809b060 The game sail(6) has a function Write() which is used both with
integer arguments and with string arguments (cast to long, and in one
place to int).  The patch here cleans this up, making it into two
separate functions; this allows for the game to be made const-correct
in future and improves portability.

The patch also contains two other fragments: a change to use the
symbolic constant SEEK_END with fseek(), and a change to use snprintf
in one place to avoid a buffer overrun.

Via PR 6569 by Joseph Myers <jsm28@cam.ac.uk>.
1999-02-10 00:45:45 +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 f92ae4adb5 remove unused files (PR#6083 by Joseph Myers <jsm28@cam.ac.uk>) 1998-09-13 15:22:57 +00:00
hubertf eb2507ecb2 fix prototype, per PR#5867 1998-09-11 14:11:57 +00:00
veego 04afeca685 Add braces to make the new egcs happy. 1998-08-30 09:19:36 +00:00
hubertf f6bdc1c682 Rename internal move() to move_ship(), as per PR 5841 by
Joseph Myers <jsm@octomino.demon.co.uk>.
1998-07-25 10:52:14 +00:00
mrg d1dea0fb5f add missing extern to several variables. 1998-03-29 04:57:19 +00:00
mrg 66c8bb21a9 remove extern errno. 1998-03-29 04:56:46 +00:00
jtc 2065ddb3da Simply include -lcurses instead of -lcurses -ltermcap 1998-02-18 22:37:30 +00:00
christos 28a0fb7260 Use -ltermcap instead of -ltermlib. 1998-02-05 12:24:31 +00:00
mrg 6074e1b476 install games that need it setgid. 1997-11-20 00:12:30 +00:00
christos 5175902c09 - make sure that the arguments to the printf like functions are correct
- add a makemsg() function to accompany makesignal.
1997-10-13 21:02:57 +00:00
christos bf72b656b0 Warns fixes:
use varargs properly
	use unsigned chars where appropriate
	fix typos
	eliminate gcc warnings
1997-10-13 19:42:53 +00:00
lukem 4877bdbb3b enable WARNS?=1 by default, & temporarily disable for the few unclean programs 1997-10-12 14:21:44 +00:00
thorpej 0211b09284 Change the riggings to ints, so that comparisons against negative
values works as expected on systems with unsigned chars.
1997-04-19 07:35:33 +00:00
tls 156daa7a47 Sync to 4.4BSD-Lite2 1997-01-07 12:42:14 +00:00
tls bd34844797 Import from 4.4BSD-Lite2 1996-12-28 19:09:10 +00:00
perry c684fe390d nuke 'the the' typo 1996-12-04 00:21:29 +00:00
mycroft 58da557ed6 Use POSIX signal and tty semantics. 1995-04-28 21:30:16 +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 982615d7df clean up import, NetBSD RCS IDs 1995-04-22 10:36:43 +00:00
cgd c4c01d75b2 specify man pages the new way. 1994-12-22 09:31:26 +00:00
cgd c524ac711f setuid rather than setruid 1994-04-08 18:23:31 +00:00
glass b192754e19 fixed to use fgets() 1994-01-13 19:22:29 +00:00
glass 862f7b5f17 fixed spelling of Napoleon 1994-01-13 18:24:40 +00:00
cgd a7bedc2399 new curses 1993-11-10 15:59:04 +00:00
mycroft 8edb8b3bd7 Use '\a', not CTRL('g'). 1993-08-10 02:20:52 +00:00
mycroft 969fb0bc6e Pass the signal number to tstp(). 1993-08-10 02:15:07 +00:00
mycroft 8542364e07 Add RCS identifiers. 1993-08-01 18:49:50 +00:00
mycroft b1bd4afedc Add RCS indentifiers. 1993-08-01 07:42:49 +00:00
mycroft cda4f8f6ee Add RCS identifiers. 1993-08-01 05:37:30 +00:00
deraadt 799dc259d9 BADSIG --> SIG_ERR 1993-06-21 00:55:05 +00:00
cgd f620d7d9f6 got rid of unnecessary -lcompat and associated dependency 1993-03-23 02:44:38 +00:00
cgd 61f282557f initial import of 386bsd-0.1 sources 1993-03-21 09:45:37 +00:00