Commit Graph

80 Commits

Author SHA1 Message Date
dholland 1e99780e5d sprinkle static 2009-08-12 08:44:45 +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
dholland 130a8172b6 ANSIfy. Remove unnecessary casts. Clean up for -Wsign-compare. Make more
things file-static. Other minor tidyups, and fix a couple minor bugs found
along the way.
2008-01-14 03:50:01 +00:00
dholland 23c02a454f Whitespace/KNF nits. 2008-01-14 00:23:51 +00:00
dholland e94a5bc9f9 Comprehensive (or at least extensive) string handling cleanup for rogue.
This patch dates (mostly) back to 2002; the critical parts of it were
handled back then by security-officer. As far as I know, there's
nothing exploitable fixed herein.

A slightly earlier version of this patch was reviewed by Christian Biere
when I filed it as PR 34750.
2007-12-27 23:52:59 +00:00
perry 8b0f9554ff convert __attribute__s to applicable cdefs.h macros 2007-12-15 19:44:37 +00:00
christos 47169552b3 XXX: GCC uninitialized 2006-05-14 03:15:50 +00:00
snj a640fe8c43 It's "its." 2006-04-24 19:00:29 +00:00
christos a7a74df4fa Coverity CID 2788: If no room gets returned, don't try to place a monster. 2006-04-02 00:13:29 +00:00
jnemeth e61c7de467 Coverity CID 2452: possible negative array index; CID 1518 and CID 1517: possible overrun of static array 2006-03-30 05:04:22 +00:00
jnemeth 1c3223f073 Coverity CID 1288: possible negative array index 2006-03-30 04:41:15 +00:00
jnemeth 67f465476e Coverity CID 993: dereference of NULL pointer 2006-03-30 04:27:24 +00:00
jnemeth cc2349eefc Coverity CID 1293: not checking for an error return 2006-03-30 04:19:38 +00:00
jnemeth fa4599a211 Coverity CID 1287: not checking for error return 2006-03-30 04:10:04 +00:00
abs f4f2f41178 Call fclose() appropriately if there is a problem with the save file.
Coverty CID 2063
2006-03-17 23:04:01 +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
tron bd52bf6180 Change marker from "pmppc" to "powerpc" because a NetBSD-macppc build
is also affected.
2005-06-09 12:20:12 +00:00
he 1ce7c753b3 Add an initialization to placate -Wuninitialized.
Marked with XXXGCC for pmppc (found while compiling for it).
2005-06-09 09:36:19 +00:00
jsm b91a81ab9f Cast last argument of execl to (char *).
Reviewed by <hubertf>.
2005-02-15 12:56:20 +00:00
jsm 2773e864bb Avoid arrays of incomplete types (required to build with GCC 4).
Reviewed by <hubertf>.
2005-02-15 12:54:50 +00:00
wiz d20841bb64 Uppercase CPU, plural is CPUs. 2004-02-13 11:36:08 +00:00
jsm cb5fd8342e Remove uses of __P. 2004-01-27 20:30:28 +00:00
jsm 5a753461bf Don't use -fwritable-strings. Add one more const. 2004-01-01 16:05:12 +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
lukem 001c68bd94 Rename a large chunk of the make(1) variables which refer to a
program/tool from "FOO" to "TOOL_FOO".  The new variables are:
	TOOL_ASN1_COMPILE  TOOL_CAP_MKDB  TOOL_CAT  TOOL_CKSUM  TOOL_COMPILE_ET
	TOOL_CONFIG  TOOL_CRUNCHGEN  TOOL_CTAGS  TOOL_DB  TOOL_EQN  TOOL_FGEN
	TOOL_GENCAT  TOOL_GROFF  TOOL_HEXDUMP  TOOL_INDXBIB  TOOL_INSTALLBOOT
	TOOL_INSTALL_INFO  TOOL_M4  TOOL_MAKEFS  TOOL_MAKEINFO  TOOL_MAKEWHATIS
	TOOL_MDSETIMAGE  TOOL_MENUC  TOOL_MKCSMAPPER  TOOL_MKESDB
	TOOL_MKLOCALE  TOOL_MKMAGIC  TOOL_MKTEMP  TOOL_MSGC  TOOL_MTREE
	TOOL_PAX  TOOL_PIC  TOOL_PREPMKBOOTIMAGE  TOOL_PWD_MKDB  TOOL_REFER
	TOOL_ROFF_ASCII  TOOL_ROFF_DVI  TOOL_ROFF_HTML  TOOL_ROFF_PS
	TOOL_ROFF_RAW  TOOL_RPCGEN  TOOL_SOELIM  TOOL_SUNLABEL  TOOL_TBL
	TOOL_UUDECODE  TOOL_VGRIND  TOOL_ZIC

For each, provide default in <bsd.sys.mk> of the form:
	TOOL_FOO?=	foo
and for the ${USETOOLS}=="yes" case in <bsd.own.mk>, provide override:
	TOOL_FOO=	${TOOLDIR}/bin/${_TOOL_PREFIX}foo

Document all of these in bsd.README.

This cleans up a chunk of potential (and actual) namespace collision
within our build infrastructure, as well as improves consistency in
the share/mk documentation and provision of appropriate defaults for
each of these variables.
2003-07-10 10:33:58 +00:00
wiz 7bd171e1c0 Drop a trailing dot. From jmc@openbsd. 2003-04-26 21:30:51 +00:00
simonb 276fd1665c The Double-Semi-Colon Police. 2003-01-20 05:29:53 +00:00
pooka b99251db10 Add ${MACROS} to ${ROFF} usage to make output readable
from jbernard@mines.edu in misc/19685
2003-01-05 12:34:26 +00:00
mrg 4a05361ffa - use correctly bounded strings when reloading a saved game. in particular,
do not let the save game file "string length" exceed the amount of space
supplied.  as noted by <stanojr@iserver.sk> on bugtraq.
- minor KNF.

tested by simonb.
2002-10-01 14:18:57 +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
tron 10f663ea7a Make "rogue" build with "WARNS=2". The necessary patches were supplied
by David A. Holland in PR bin/17498.
2002-07-07 09:35:07 +00:00
blymn 7147df1ef5 Change deprecated curses call to new equivalent. 2001-12-06 12:19:44 +00:00
wiz e7a85c433d Fix pasto. From FreeBSD. 2001-08-09 13:09:59 +00:00
wiz e65cad56b9 Fix for FreeBSD/13278, from FreeBSD:
When a game ends that makes the top 10, the function insert_score in
score.c is called to make the new score file.  But the case for KFIRE
(killed by fire) incorrectly uses strcpy instead of strcat (all the
other cases use strcat).  This puts the string in the wrong place and
corrupts the score file.
2001-08-09 13:02:49 +00:00
christos 16263c885d remove duplicate decls 2001-02-05 01:04:25 +00:00
itojun d303927592 printf() pedant - do not pass variable alone, use %s.
idea from openbsd.  after looking at freebsd commit msgs from kris@freebsd.
2000-07-10 10:19:25 +00:00
matt 3233065035 More include additions for exit, abs, strcmp, etc. 2000-07-03 03:57:39 +00:00
soren 3872dc30f7 Fix doubled 'the'. 2000-03-13 22:53:22 +00:00
jsm 20e3305006 Fix -Wsign-compare warnings. 1999-09-18 19:38:46 +00:00
jsm 34d9941aa7 Fix buffer overrun in rogue. 1999-09-13 17:19:55 +00:00
jsm 50ab22237f Remove rogue's old and bit-rotten cut-down version of curses. 1999-09-13 17:14:07 +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 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
abs 190c71aa67 s/SETUIDGAME/SETGIDGAME/ - catch up with the rest of the world. 1999-04-05 08:04:48 +00:00
hubertf 6d265b3268 constify, per PR 6148 1998-11-10 13:01:31 +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 eb2507ecb2 fix prototype, per PR#5867 1998-09-11 14:11:57 +00:00