Commit Graph

133 Commits

Author SHA1 Message Date
fox
c0ad960a60 games/battlestar: Replace snprintf(3) with strlcpy(3) for better performance.
Reviewed by: kamil@
2020-02-06 22:09:43 +00:00
fox
19f84ebb48 games/battlestar: Fix the -Werror=restrict warning.
Replace strcpy(1) with the safer snprintf(3) which guarantees NULL
termination of strings.

Error was reported when build.sh was run with MKLIBCSANITIZER=yes flag.

Reviewed by: kamil@
2020-02-05 20:11:54 +00:00
christos
0e5c7640e2 Gcc-8 bug confusion with restrict on sh3 2019-10-29 21:30:42 +00:00
mrg
c8bf876ced expand the internal consistency checks in truedirec() to avoid
fallthrough cases.  now if direction turns up wrong (it should
not, but this code can't tell that, and convert it to an enum
that would also fix this, is more effort than this is worth.
2019-10-05 23:34:14 +00:00
mrg
fbffadb9f8 - add or adjust /* FALLTHROUGH */ where appropriate
- add __unreachable() after functions that can return but won't in
  this case, and thus can't be marked __dead easily
2019-02-03 03:19:25 +00:00
mrg
31c4a0256f fix issues found by GCC 6.4:
battlestar was missing some {} in its insane printf()+puts() usage.
this is a literal code sequence i found:

	printf("The blast catches ");
	printf("the goddess in the ");
	printf("stomach, knocking ");
	puts("her to the ground.");
	printf("She writhes in the ");
	printf("dirt as the agony of ");
	puts("death taunts her.");
	puts("She has stopped moving.");

no lines inserted or removed.

tetris' checkscores() had wrong and missing {} usage.
2018-02-04 08:48:05 +00:00
dholland
4d631eb951 Use random(), not rand(). 2014-03-22 23:33:33 +00:00
dholland
ffe2e1f51c avoid unnecessary floating point ops 2014-03-22 23:31:28 +00:00
dholland
84ecadaa86 avoid signed left-shift 2014-03-22 23:23:55 +00:00
dholland
6955cd2022 Use CHAR_BIT, not 8. 2014-03-22 23:16:21 +00:00
dholland
e31613d908 Pass -Wstrict-overflow. 2012-10-13 19:58:53 +00:00
dholland
277bd0756c WARNS=5, and make WARNS=5 the default for src/games. 2012-06-19 05:46:08 +00:00
christos
7f5fd4a5cd PR/45842: Henning Petersen: compare fgets with NULL not 0 2012-01-16 17:38:16 +00:00
dholland
ae56ae8f3f Use __dead and __printflike instead of __attribute__. 2011-08-26 06:18:16 +00:00
joerg
2d6cc1dbb0 Don't use return value of a function as format string. 2011-05-23 22:44:18 +00:00
dholland
b8a40a1a76 fflush the score file while signals are blocked to decrease the chance of
it getting corrupted.
2010-04-24 00:38:30 +00:00
christos
ff4e4fcdee fix typo. 2010-04-02 19:34:44 +00:00
christos
84ea502702 handle ctime returning NULL. 2010-04-02 15:34:16 +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
9795f61a5a sprinkle static 2009-08-12 05:17:57 +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
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
jmc
bd6068f403 KNF and WARNS=3 2005-07-01 06:04:46 +00:00
dsl
49f7d8a9b1 Add (unsigned char) cast to ctype functions 2004-11-05 21:30: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
52db8880b1 Grammar fixes, from jmc@openbsd. 2003-04-26 21:29:10 +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
ross
dc5571b22e Generate <>& symbolically. I'm avoiding .../dist/... directories for now. 2002-02-08 01:21:55 +00:00
blymn
665c88dc3c Convert old deprecated curses call to new equivalent. 2001-12-04 13:00:24 +00:00
tv
cd5f83cb29 Rename com#.c to command#.c to avoid conflicts with those file basenames
on certain Microsoft host OS's.
2001-10-19 03:06:09 +00:00
wiz
3f9984fc90 existent', not existant' 2001-06-19 13:42:07 +00:00
christos
42c813cc0b don't deref -1. 2001-06-02 17:30:28 +00:00
wiz
834bb1b3ab Whitespace and/or punctuation fixes. 2001-04-02 22:42:37 +00:00
jsm
5fd015d6f6 In cypher(), don't attempt to make sense of words other than VERBs or
KNIFE when a verb is required.  Add AUXVERB for "make", "move",
"climb" (as in "make love", "climb up") and ignore AUXVERB as a verb,
going on to the next word, instead of treating these words as
adjectives.  When creating new verbs from "put on", "put down", "take
off", mark them as type VERB.  Mostly from Paul Janzen
<pjanzen@foatdi.harvard.edu>.
2000-09-25 19:37:58 +00:00
jsm
ca0c4d77e3 Add new flags OBJ_PERSON and OBJ_NONOBJ to the objflags array. 2000-09-25 14:44:59 +00:00
jsm
e2872de219 Add OBJ_AN flag to objflags so as to use "a" or "an" appropriately in
messages; avoids "a amulet", "a Elf".  Define and use macros to use
"a", "an", "the", "is", "are" appropriately.  Partly based on OpenBSD.
2000-09-25 14:08:08 +00:00
jsm
293597460a Remove excess blank lines. From OpenBSD. 2000-09-25 14:06:20 +00:00
jsm
4cf0caf4ef Fix loving already loved goddess; avoid fallthrough after loving
goddess; give error on "love amulet".  From OpenBSD.
2000-09-25 14:05:52 +00:00
jsm
9cffc34578 Use defined constant FINAL instead of hardcoded 275. From OpenBSD. 2000-09-25 00:33:18 +00:00
jsm
f97a3c82c3 Fix logic error in use of n and wordnumber in murder() when using
laser.  From OpenBSD.
2000-09-25 00:28:54 +00:00
jsm
572a824811 Discard any part of a line of input that goes beyond our buffer rather
than treating it as our next line of input.  From OpenBSD.
2000-09-24 15:51:40 +00:00
jsm
96232c1c4d Give less cryptic messages than "-1%" when WEIGHT or CUMBER are zero. 2000-09-24 14:42:18 +00:00
jsm
ad9cea40fa Add explicit no-ops to empty loops following the NetBSD style guide. 2000-09-24 14:20:23 +00:00
jsm
579d7e283b Make hash table static in parse.c. 2000-09-24 14:11:09 +00:00
jsm
91d0e30d01 Use NULL instead of 0 (from OpenBSD). Also add or adjust comments. 2000-09-24 09:47:22 +00:00
jsm
ac1f171d5b Correct spelling "dont" to "don't". From OpenBSD. 2000-09-24 09:46:57 +00:00
jsm
44c05578b0 Make functions local to parse.c static. 2000-09-24 09:46:28 +00:00