mestre
aed906e4b2
This diff is rather large, but it's just simply removing unnecessary headers
...
, remove some lint-style comments, add missing void to functions without args,
also some function prototypes (extern) were missing their args, so I added them
as they were defined in hack.h
OK tb@ on separate diffs
2016-01-09 18:33:15 +00:00
mestre
5c1af24d78
ANSIfy gomoku(6) and change a char* to u_char*
...
OK tb@
2016-01-08 21:38:33 +00:00
mestre
747bd22203
ANSIfy sail(6) plus some cleanup
...
OK tb@
2016-01-08 20:26:33 +00:00
mestre
96822cf7b9
Headers clean up
2016-01-08 20:23:54 +00:00
mestre
44d3f3fb69
Remove unnecessary headers an sort
2016-01-08 20:19:06 +00:00
mestre
ab8b84f49d
Straightforward headers cleanup
2016-01-08 20:15:15 +00:00
mestre
211c418389
ANSIfy monop(6)
...
OK tb@
2016-01-08 18:20:33 +00:00
mestre
91d732828b
Headers cleanup and removal where suitable
...
OK tb@
2016-01-08 18:19:47 +00:00
mestre
56f9a7dc4a
ANSIfy mille(6)
...
OK tb@
2016-01-08 18:09:59 +00:00
mestre
182ed36cc5
Headers cleanup and also the following:
...
mille.h:
#define CTRL locally, which is used by move.c and misc.c, to avoid including
termios.h or sys/ttydefaults.h where it's actually defined
varpush.c:
Change _PATH_DEVNULL to "/dev/null" since other systems may not have it defined
but also avoids including <paths.h>
Included a few sugestions from tb@ who also gave his OK
2016-01-08 18:05:58 +00:00
tb
95d0ce2685
add missing 'void'
...
ok mestre@
2016-01-08 13:40:05 +00:00
tb
8a9ce47a2b
Structural integrity hasn't improved in over twenty years.
...
ok mestre@
2016-01-08 13:33:42 +00:00
mestre
0f16a76c9f
ANSIfy hunt(6)
...
Note: casted 2 args to struct sockaddr * on list.c to shut off compiler
warnings, and also changed an int len to socklen_t since recvfrom(2) receives
the last argument as the latter.
I'm running out of credits, but this was once again with great help and OK from
tb@
2016-01-07 21:37:53 +00:00
mestre
9ef4854330
Headers cleanup and sorting
...
OK tb@
2016-01-07 21:29:31 +00:00
millert
7146b7ce3e
hack expects to be able to read ^Z as a normal character so disable
...
SUSP in the termios settings. Presumably this is how things worked
before the conversion to termios. Fixes suspend/resume in hack.
2016-01-07 18:25:52 +00:00
tb
17641e3181
Some basic code maintenance in games/
...
- in main() replace exit with return
- drop some /* NOTREACHED */ lint comments along the way.
- make more use of standard CFLAGS, esp. -Wimplicit-function-declaration
- add and sort some headers when needed
- add straightforward pledges to some programs used at compile time
discussed with and ok mestre@
2016-01-07 16:00:31 +00:00
mestre
11da2480c6
ANSIfy trek(6)
...
Note: Binary change is introduced due to function schedule() where its args are
(int,double,char,char,char), but on trek.h are (int,double,int,int,int). Changed
to the latter since the 3 last args are coordinates.
OK tb@
2016-01-07 14:37:51 +00:00
mestre
48b4d137c7
Remove unnecessary headers and sort the remaining alphabetically
...
OK tb@
2016-01-07 14:30:32 +00:00
mestre
d39a14bb10
Forgot to remove this file on my previous commit
2016-01-06 14:32:14 +00:00
mestre
010ae45bb5
Remove unnecessary header files from phantasia(6)
...
Lesson learnt: don't include an header sorted alphabetically just because. The
external definition of variables was done on phantglobs.h but their declaration
was on phantstruct.h and therefore the latter must be included before the
former. It's easier to just include phantstruct.h inside phantglobs.h since it
always need it.
With help and OK from tb@
2016-01-06 14:28:09 +00:00
tb
85d02bc06c
ansify
...
ok mestre@
2016-01-06 10:28:38 +00:00
tb
6b45e2a858
Last step of ansification of phantasia:
...
Convert function() to function(void).
ok mestre@
2016-01-06 09:43:26 +00:00
tb
f0d3161e56
Ansify the bulk of phantasia. No binary change on amd64. Based
...
on an older diff by mestre.
ok mestre@
2016-01-06 09:39:51 +00:00
tb
d973fa72ce
Ansify map.c.
...
ok mestre@
2016-01-06 09:29:34 +00:00
tb
65e3e2c50a
Use return instead of exit from main.
...
ok mestre@
2016-01-06 09:24:38 +00:00
mestre
2010f3c835
More cleanup and sorting on header section
...
OK tb@ and he also pointed out that for consistency with rest of the tree we
should include termios.h instead of sys/ttydefaults.h, where applicable
2016-01-04 17:33:24 +00:00
mestre
bdf3894f0c
More headers removal and sorted the remaining alphabetically.
...
Most noticeable that were removed are sys/types.h which will be included from
stdlib.h and in turn also brings along sys/cdefs.h. The other one is limits.h
that was used with the old idiom (denom * random() / LONG_MAX), although it was
only removed were applicable (some files still need that header).
OK tb@
2016-01-04 11:58:35 +00:00
mestre
9ea8ec706f
About 13 years ago when the idiom srandom(time()), and sometimes
...
srandom(time()+getpid()), was changed by srandomdev(), but #include <time.h>
lived up until this day so remove it.
Additionally, earlier than that, 18 years ago, random(6) was one of the first
consumers of arc4random(3) family, and was pulling it from dev/rndvar.h but
these days we pull it from stdlib.h, which is already done, so while here
remove dev/rndvar.h also.
"seems comprehensive to me" deraadt@ and OK tb@
2016-01-03 14:38:16 +00:00
tedu
43a866b79e
don't declar main. from Michal Mazurek
2016-01-01 15:56:03 +00:00
mestre
f741f25ef3
Include only needed header files per each source file
...
This one was also OK'ed by tb@
2015-12-31 18:10:19 +00:00
mestre
ea24c44aa7
Include only needed header files per each source file
...
OK tb@
2015-12-31 17:51:19 +00:00
mestre
0e3a25f04f
Remove unused file
...
Alerted by tb@
2015-12-31 16:54:42 +00:00
mestre
2317ec67b0
Include only needed header files per each source file
...
OK tb@
2015-12-31 16:50:29 +00:00
mestre
39ac0be569
Include only needed header files per each source file
...
OK tb@
2015-12-31 16:44:21 +00:00
mestre
5122c2800b
Include only needed header files per each source file
...
With help and OK from tb@
2015-12-31 15:20:36 +00:00
tb
d9138424f2
Michal Mazurek pointed out on tech@ that the factor.6 manual needs a bit
...
of clarification. Thus, express the description both more concisely and
more precisely. Drop details about spaces in the output formatting.
While there, update the corresponding comment in the source code.
With input from jmc@ and mestre@; detailed discussion with sobrado@.
ok sobrado@
2015-12-30 14:07:53 +00:00
tb
3c9e3b93e0
Build most of games/ with -Werror-implicit-function-declaration.
...
Prompted by benno's addition of the flag to most of usr.sbin/.
ok benno@
2015-12-28 20:55:55 +00:00
jmc
a5227f0bfd
update the us army democracy excerpt to more closely
...
match the format of the original;
from andre smagin
2015-12-28 12:32:12 +00:00
jmc
424c5ce6b8
andy finkel confimed himself as the originator of the rigged demo quote;
...
from netbsd pr 49451
2015-12-28 08:36:10 +00:00
chl
3fc7680a4e
remove unused variables
...
ok mmcc@
2015-12-27 01:28:02 +00:00
chl
df06dc93d0
remove unused variable
...
ok tb@
2015-12-27 01:24:27 +00:00
mestre
7ad55f5581
Set as __dead a few more functions, that don't return, on games/
...
With precious tip, help and also OK from tb@
2015-12-26 00:26:39 +00:00
gsoares
d73a3bc6bc
- use strtonum(3) instead of atoi(3)
...
- while here switch main() to return instead of exit(3), makes stack protector happy.
OK tb@
2015-12-25 23:41:43 +00:00
mestre
f0628b46ae
Declare usage() functions as __dead void, if they don't return, on games section.
...
Found another one in arithmetic(6) which also didn't return, and removed a function from number(6) which is not used anymore.
OK tb@
2015-12-25 20:59:09 +00:00
mestre
cd84dbda79
Apply some more KNF to the declaration of functions, but keep style to the rest of code for now.
...
OK tb@
2015-12-25 03:20:57 +00:00
tb
15d5404dbf
Function prototypes and a little bit of KNF.
...
Committing on behalf of mestre@ who has more to come.
2015-12-24 16:55:13 +00:00
tb
da03d969c4
KNF: add a missing space after an 'if'.
2015-12-18 18:47:56 +00:00
tb
466e81dfe1
Use __progname instead of hand-rolled parsing of argv[0].
...
Inspired by similar diffs by tobias@ and millert@.
"I like the concept" pjanzen@
ok tedu@
2015-12-16 14:21:50 +00:00
tb
48aa608063
Use __progname instead of hand-rolled parsing of argv[0].
...
Inspired by similar diffs by tobias@ and millert@.
"I like the concept" pjanzen@
ok tedu@
2015-12-16 14:16:27 +00:00
tb
6dd9349555
Cleanup: pwd.h is no longer needed.
2015-12-15 18:40:54 +00:00
tb
54a07f1471
Replace 'arc4random() % range' by 'arc4random_uniform(range)'.
...
Do this by introducing atcrandom_uniform(range) which returns
deterministic randomness or good randomness depending on whether
a seed was specified with the -r option.
Diff by Matthew Martin, reviewed by deraadt@ and me.
ok deraadt@
2015-12-15 18:39:50 +00:00
jsg
6b024eb539
include err.h for err()
2015-12-09 02:00:40 +00:00
tobias
dab586c435
Use __progname instead of manually handling argv[0].
...
ok deraadt, mmcc, tedu
2015-12-06 12:00:16 +00:00
tb
43b9874dbc
pledge "getpw" is not needed here.
...
ok semarie@
2015-12-06 11:22:37 +00:00
tb
da74d77a50
Treat quiz the same way as the other games and try to preserve the look
...
and feel. Revert previous and allow the pager with pledge "proc exec".
Play the game with pledge "stdio rpath".
Discussed with tedu@
2015-12-06 09:55:58 +00:00
tb
23d7e0c886
add missing #include "hack.h"
2015-12-05 13:37:43 +00:00
tb
98e40f6899
Tweak alignment of ENVIRONMENT and FILES.
...
Use sentence format for the highscore file, too.
Discussed with jmc@
2015-12-04 19:46:04 +00:00
jmc
05ea1278d2
put FILES into a similar format as ENVIRONMENT;
2015-12-04 19:21:26 +00:00
tb
d3431a599d
cleanup: remove pwd.h, delete a stray comment and a const qualifier
2015-12-04 17:34:40 +00:00
tb
87b7d5d4a1
Drop pledge("getpw") and pwd.h and use the now usual
...
LOGNAME -> USER -> getlogin() -> ??? fallback
in the score file, as requested by tedu@
Man page bits adapted from jmc@'s tweaks to snake.6
2015-12-04 16:40:09 +00:00
tedu
c11bd13a73
assume modern curses and unifdef ancient feature tests
2015-12-04 10:41:35 +00:00
tb
091d139da5
Drop the argument passing between backgammon and teachgammon.
...
It's broken. Instead, make -d imply -n. You're supposed to
know the rules before you start tweaking them.
Issue reported by and ok pjanzen@
Patient help with the manual jmc@
2015-12-02 20:05:01 +00:00
tb
fd639ccef0
KNF: I forgot to join two lines.
2015-12-02 18:52:23 +00:00
tb
4a0e2eed87
treat getenv("HOME") safely also when LOGGING is defined. from mestre.
...
plus fix some ghastly whitespace.
2015-12-02 18:46:13 +00:00
tb
c5e67ec545
add const and remove unused variable.
...
from mestre.
2015-12-02 18:34:10 +00:00
tb
1152c6e6e1
Make sure "exec" rights are dropped asap in all code paths.
...
The game also needs "wpath cpath" for supporting the score file,
so add those.
2015-12-01 07:43:30 +00:00
tb
1f22a2a091
Answering "yes" to the question "Do you want to see the rules of the game?"
...
execs teachgammon. Allow this and drop this pledge afterward.
Spotted by Paul Janzen, thanks!
2015-12-01 00:31:46 +00:00
schwarze
d6d428c736
delete useless BUGS section; patch from Jan Stary <hans at stare dot cz>
2015-11-30 16:53:39 +00:00
tb
56e43436ce
last but not least: add pledge for wump(6)
...
one more of those games which fork a pager with instructions, so first
pledge "stdio rpath proc exec", then drop to pledge "stdio" afterwards.
2015-11-30 09:00:02 +00:00
tb
f01d2bc3df
pledge "stdio rpath wpath cpath" for this one.
2015-11-30 08:55:26 +00:00
tb
0a5000655c
primes only needs pledge "stdio".
2015-11-30 08:53:53 +00:00
tb
2751bcea94
The usual deal for a curses game with the possibility of saving a game:
...
pledge "stdio rpath wpath cpath tty"
2015-11-30 08:49:06 +00:00
tb
81b3eda1fe
unspectacular pledge "stdio rpath tty" for grdc
2015-11-30 08:46:07 +00:00
tb
24c4b92ed4
straightforward pledge "stdio rpath wpath cpath tty" for gomoku
2015-11-30 08:44:51 +00:00
tb
95ae2554fc
slightly interesting pledge for fish:
...
start with "stdio rpath proc exec" since it pipes instructions to a pager
afterwards "stdio" is enough
2015-11-30 08:42:03 +00:00
tb
9ba11e5c36
pledge "stdio rpath wpath cpath tty" for canfield
...
pledge "stdio rpath" for cfscores
made possible by Ricardo Mestre's earlier work
2015-11-30 08:38:13 +00:00
tb
efef3032b3
pledge "stdio rpath tty" for bs
2015-11-30 08:33:29 +00:00
tb
02cc2a4e8b
pledge "stdio rpath tty" for boggle.
...
skip mkdict and mkindex for now, they aren't installed anyway.
2015-11-30 08:27:46 +00:00
tb
87f25a4abf
Pledge for backgammon and teachgammon.
...
Both are straightforward "stdio rpath tty" programs; teachgammon
exec's backgammon at the end, so give it "exec" in addition.
While there, ANSIfy
2015-11-30 08:19:25 +00:00
tb
a75265e181
Straightforward pledge "stdio rpath wpath cpath" for adventure.
...
It is possible to make it finer grained, but try to keep it
simple for now.
2015-11-30 08:14:48 +00:00
jmc
e8dcef998f
tidy here too;
2015-11-29 16:05:38 +00:00
jmc
1e9e54e85f
adjust width list: Ds is unfortunate here;
2015-11-29 16:04:14 +00:00
jmc
121e37575f
tidy up ENVIRONMENT and FILES;
2015-11-29 15:58:38 +00:00
tb
c425f3ea0e
Move score file to $HOME and add pledge "stdio rpath wpath cpath".
...
For high score entries, try LOGNAME, then USER, then getlogin() then
fall back to ???.
2015-11-29 15:31:06 +00:00
tb
bf2d39770d
Add pledge support and move score file to $HOME.
...
For high score entries use the same logic as in snake(6) and tetris(6):
Try LOGNAME then USER then getlogin(2) and fall back to ???.
For variety, atc(6) uses flock(2), so add a "flock" promise to the usual
"stdio rpath rpath cpath tty" for games.
2015-11-29 15:23:38 +00:00
tb
e224588fb3
Move scorefile to $HOME. The nice implementation of the score file
...
depends on getpwuid(), so add "getpw" to the rest of the required
pledges: "stdio rpath wpath cpath tty".
2015-11-29 15:13:19 +00:00
tb
6c53a56d23
pledge "stdio rpath tty proc exec" since instructions() might fork a pager.
...
actual game place takes place with "stdio tty".
OK deraadt@ on an earlier version
2015-11-29 14:42:36 +00:00
tb
fa83b6130f
Prefer $LOGNAME over $USER, since the latter is deprecated,
...
see environ(7). Pointed out by millert@. Fall back to getlogin(2)
before defaulting to ???.
looks good to deraadt@
2015-11-29 14:31:01 +00:00
tb
f527bb5663
Fix after removal of the setgid bit:
...
Add pledge "stdio rpath wpath cpath tty".
Move score file to $HOME, add $USER as high score entry.
Maintain hall of fame of 10 high scores, make snake wink if
it ate you while you were eligible for eternal fame.
Based on an initial diff by Ricardo Mestre and with helpful input from tedu@.
ok beck@
2015-11-27 09:37:56 +00:00
tb
a846715f27
Fix copy-paste error in scorefile name
...
From Ricardo Mestre
2015-11-26 14:43:18 +00:00
tb
1cf6a71907
Add checks for getenv(), snprintf() and getlogin().
...
From Ricardo Mestre (up to a small tweak). Thanks!
2015-11-26 13:28:22 +00:00
tb
0f70ac25c7
Add missing checks for getenv() and snprintf()
...
From Ricardo Mestre, thanks!
2015-11-26 13:24:30 +00:00
deraadt
691147a9d6
Remove operations that "touch" scorefiles at install time.
2015-11-25 23:18:11 +00:00
tb
4c4ddf9345
Remove now unused gid_t variable.
...
From Ricardo Mestre. Thanks!
go for it! deraadt@
2015-11-25 16:19:05 +00:00
tb
ca7aa068af
The scorefile is hidden.
...
From Ricardo Mestre, thanks!
2015-11-25 16:15:06 +00:00
tedu
e10665cf08
repair lseeks, from Ricardo
2015-11-24 16:54:22 +00:00
deraadt
ebb0af75bc
In 1995, all of the games were setuid games. At end of 1996, I took them all
...
to setgid games, and we started wittling them down. Nearly 10 years later I
am removing all setgid from the games. If any of these have score files they
are now broken, and I hope various folk repair them. I have argued for years
(and received pushback...) that the score file features must be removed, or
rewritten to use private files, because setgid is the wrong tool.
ok tedu
2015-11-24 03:10:09 +00:00
tedu
e1edfc7be0
change score file name to .cfscores so it's not taking up valuable space
...
in my home directory of serious business files
2015-11-24 02:53:39 +00:00
tedu
7e0a668373
move score files to home directory and drop setgid. from Ricardo Mestre
2015-11-24 02:51:50 +00:00
deraadt
db911c4702
pledge the wyrms
2015-11-21 05:29:42 +00:00
deraadt
e25b81396d
pledge "stdio rpath wpath cpath"
...
from Ricardo Mestre
2015-11-21 03:20:30 +00:00
tb
72a685fd06
Convert hand-rolled option parsing to getopt(3).
...
ok deraadt@
2015-11-20 16:58:37 +00:00
tb
8f55f2bb60
pledge "stdio rpath wpath cpath tty"
...
"stdio rpath tty" for game play
"rpath wpath cpath" for maintaining highscores in $USER
ok deraadt@ sthen@
2015-11-20 07:40:23 +00:00
tedu
df1ad1934e
remove setgid flag.
...
in turn, move score files into user's home directory.
will let theo buehler continue with a smaller pledge set.
2015-11-17 15:27:24 +00:00
jmc
a7a0269383
fix a double space issue in the following, rather wonderful, fortune:
...
On two occasions I have been asked [by members of Parliament!], `Pray,
Mr. Babbage, if you put into the machine wrong figures, will the right
answers come out?' I am not able rightly to apprehend the kind of
confusion of ideas that could provoke such a question.
-- Charles Babbage
2015-11-15 21:25:50 +00:00
deraadt
f24baa2d48
creat() -> open equiv; from Frederic Nowak
2015-11-11 01:12:09 +00:00
deraadt
37753c2d3b
another open(path, 0)...
2015-11-10 15:29:11 +00:00
deraadt
574fb2a2db
pledge "stdio rpath" at the top. (Ricardo's 2nd chunk which reduces
...
further is not placed right, so I ignored it for now)
from Ricardo Mestre
2015-11-10 14:56:50 +00:00
deraadt
7f87976609
replace open(path, 0) with open(path, O_RDONLY). amazing to still find
...
sloppiness like this.
2015-11-10 14:50:04 +00:00
tedu
677829b8e4
delete unused code that won't let you play if the load is too high
2015-11-05 23:16:44 +00:00
guenther
ec99312f72
ctype functions take unsigned char values.
...
Fix redrawing of the challenge cube (-c option) when <esc>word is used.
ok mmcc@
2015-11-05 08:40:34 +00:00
tedu
33206277fe
replace setbuf with setvbuf, from Frederic Nowak
2015-11-04 21:22:10 +00:00
tedu
5e0221f546
just dump the help on stdout with messing about with a pager.
...
makes pledge much simpler.
from jan stary
2015-10-25 09:34:49 +00:00
mmcc
75766ddb8a
Cast toupper()'s argument to unsigned char.
...
ok guenther@
2015-10-24 18:51:40 +00:00
mmcc
cb40a3d352
Cast ctype functions' argument to unsigned char.
...
ok guenther@
2015-10-24 18:49:39 +00:00
mmcc
9c23307a93
Cast ctype functions' argument to unsigned char.
...
ok guenther@
2015-10-24 18:39:05 +00:00
mmcc
c5ce2e852f
Cast ctype functions' argument to unsigned char.
...
ok guenther@
2015-10-24 18:37:23 +00:00
mmcc
e782249f09
Cast ctype functions' argument to unsigned char.
...
ok guenther@
2015-10-24 18:35:08 +00:00
mmcc
07f8b41afc
Cast ctype functions' argument to unsigned char.
...
ok guenther@
2015-10-24 18:33:22 +00:00
mmcc
8b4d100e4c
Cast ctype functions' argument to unsigned char.
...
ok guenther@
2015-10-24 18:29:15 +00:00
mmcc
5eb74ca34f
Cast ctype functions' arguments to unsigned char.
...
ok guenther@
2015-10-24 18:26:13 +00:00
mmcc
4f56e6a4e1
Cast ctype functions' argument to unsigned char.
...
ok guenther@
2015-10-24 18:16:40 +00:00
mmcc
037a1c83c4
Cast ctype functions' arguments to unsigned char.
...
ok guenther@
2015-10-24 18:14:09 +00:00
mmcc
1c1551e9c1
Cast ctype functions' arguments to unsigned char.
...
ok guenther@
2015-10-24 18:10:47 +00:00
mmcc
3618010ad0
Cast ctype functions' arguments to unsigned char.
...
ok guenther@
2015-10-24 18:04:06 +00:00
mmcc
4d3914505f
Cast isdigit()'s argument to unsigned char.
...
ok guenther@
2015-10-24 18:02:28 +00:00
mmcc
e6743bfe73
Cast isdigit()'s argument to unsigned char.
...
ok guenther@
2015-10-24 17:56:42 +00:00
mmcc
672e4212ce
Cast islower()'s argument to unsigned char.
...
ok guenther@
2015-10-24 17:55:02 +00:00
mmcc
d02bbd4a61
Cast ctype functions' arguments to unsigned char.
...
ok guenther@
2015-10-24 17:51:59 +00:00
mmcc
0d35e948a8
Cast isprint()'s argument to unsigned char.
...
ok guenther@
2015-10-24 17:48:36 +00:00
mmcc
3d31ecf887
Cast toupper()'s argument to unsigned char.
...
ok guenther@
2015-10-24 17:46:19 +00:00
mmcc
85255e44cb
Cast ctype functions' arguments to unsigned char.
...
ok guenther@
2015-10-24 17:44:49 +00:00
mmcc
8a7637b1dd
Cast ctype functions' arguments to unsigned char.
...
ok guenther@
2015-10-24 17:43:28 +00:00
mmcc
8a97e63eab
Cast ctype functions' arguments to unsigned char.
...
ok guenther@
2015-10-24 17:40:38 +00:00
mmcc
a0a49686e0
Cast isdigit()'s argument to unsigned char.
...
ok guenther@
2015-10-24 17:37:56 +00:00
mmcc
02fcf05ac9
Cast isalpha()'s argument to unsigned char.
...
ok guenther@
2015-10-24 17:36:06 +00:00
mmcc
3c57379406
Cast isblank()'s argument to unsigned char.
...
ok guenther@
2015-10-24 17:34:16 +00:00
mmcc
0cc1293efb
Cast isdigit()'s argument to unsigned char.
...
ok guenther@
2015-10-24 17:33:05 +00:00
mmcc
8059d61abf
Cast isblank()'s argument to unsigned char.
...
ok guenther@
2015-10-24 17:31:00 +00:00
mmcc
866f718f2d
Cast toupper()'s argument to unsigned char.
...
ok guenther@
2015-10-24 17:29:03 +00:00
mmcc
2c2460a1ae
Cast islower()'s argument to unsigned char.
...
ok guenther@
2015-10-24 17:27:06 +00:00
mmcc
9981a40bd6
Cast islower()'s argument to unsigned char.
...
ok guenther@
2015-10-24 17:23:14 +00:00
mmcc
01869f2877
Cast ctype functions' arguments to unsigned char.
...
ok guenther@
2015-10-24 17:20:17 +00:00
mmcc
057b7905c4
Cast ctype functions' arguments to unsigned char.
...
ok guenther@
2015-10-24 17:13:27 +00:00
jsg
b2fea133cf
include err.h for err() calls added with recent pledge commits.
2015-10-23 02:01:15 +00:00
doug
4001b1c3f4
Pledge "stdio rpath tty" for hangman(6).
...
Patch submitted by Ricardo Mestre <serial@helheim.mooo.com>
ok semarie@
2015-10-22 05:28:42 +00:00
tobias
2f95621a47
Disable !-command to escape to a shell. You are supposed to play, press
...
^Z, or open up another terminal if there is something else to do.
ok deraadt
2015-10-16 07:37:46 +00:00
doug
673e924c36
Pledge "stdio" for simple games.
...
ok semarie@
2015-10-14 08:12:12 +00:00
semarie
20b80e920a
enable pledge(2) in rain(6)
...
it is libcurses program: at init it needs "stdio rpath getpw tty", and after
drop to just "stdio tty". "tty" is needed at end for restoring the tty.
initial patch from doug@
ok doug@ deraadt@
2015-10-14 07:19:23 +00:00
doug
3ef98285c6
Pledge that arithmetic only takes "stdio".
2015-10-10 22:32:55 +00:00
guenther
f06752bb14
Delete pointless NOSTRICT comments
2015-09-27 07:06:41 +00:00
guenther
3e07b96b19
Make prompt() properly printf-like, eliminating empty dummy args
2015-09-27 05:27:42 +00:00
guenther
911134d294
Annotate funcs with __attribute__((printf(...))) and clean up the fallout:
...
* lots of foo(str) --> foo("%s", str) transformations
* one totally insane foo(fmt, ap) --> vfoo(fmt, ap) conversion: how did
this ever work?
* prefer const char[] over char* for static format strings, as it lets
gcc check the format and eliminates an unnecessary pointer
ok beck@
2015-09-27 05:13:11 +00:00
guenther
c651476829
Delete obsolete lint comments
...
ok beck@
2015-09-27 05:09:01 +00:00
guenther
aea4406c4f
Make -Wformat=2 happier with a few foo(str) -> foo("%s", str) fixes
...
ok beck@
2015-09-27 05:07:06 +00:00
schwarze
cc710aa960
Fix -D in the synopsis line:
...
* Whitespace is allowed between -D and the variable name.
* Each -D option only takes one single assignment.
* Drop excessive .Sm macro.
2015-09-25 17:50:53 +00:00
schwarze
0df4e6e283
use | rather than / for alternatives and some macro fixes
2015-09-25 17:37:23 +00:00
tedu
8476ff3c17
big blocks need braces for support
2015-09-16 16:32:11 +00:00
schwarze
eef6683313
use .Cm rather than .Ar for fixed string arguments
2015-09-12 16:10:25 +00:00
schwarze
e34c05504d
reduce .Nd to one line and kill .Tn while here
2015-09-10 15:16:43 +00:00
tedu
335a27f856
cosmetic fixes
2015-09-07 00:49:20 +00:00
semarie
6bf0ea6596
remove #ifdef OK_TO_WRITE_DISK which isn't used by default.
...
and few disambiguisations suggested by cc(1)
- parentheses around && within ||
- explicit braces to avoid ambiguous 'else'
ok doug@
2015-08-26 14:49:20 +00:00
rzalamena
d4bd758816
Replace clock_gettime UPTIME with MONOTONIC to improve worm portability.
...
ok deraadt@, guenther@.
2015-08-26 01:25:57 +00:00
rzalamena
e5f400f567
Improve robots(6) by using timespec*() functions, replacing gettimeofday()
...
with clock_gettime(MONOTONIC) to avoid clock changes and replacing poll()
with ppoll() to deal better with timespec.
ok guenther@.
2015-08-26 00:29:24 +00:00
rzalamena
df5f0d5ca1
Fix cheating bug by using unused time variables and replace poll() with
...
ppoll() to better use the timespec struct.
ok deraadt@.
2015-08-24 21:52:12 +00:00
deraadt
ca161728cb
remove malloc/calloc/realloc* casts, due to stdlib.h being present; ok millert krw
2015-08-22 14:47:40 +00:00
deraadt
40ad53c423
KNF
2015-08-21 02:42:26 +00:00
sobrado
0037dff8df
use file system path (.Pa) semantic markup macros where appropriate.
2015-07-27 18:48:04 +00:00
schwarze
485fcb80c1
Sometimes, the computer's move was printed, but the computer's men didn't
...
actually move. This happened when "swap" was called earlier, and then
later in the final call to makmove(), swapping back would have been
required, but was erroneously denied. Patch sent in pjanzen@.
It looks like the bug was already present in the original version
in 4.1a BSD in 1982.
2015-07-20 23:04:17 +00:00
deraadt
a0d5b14ebf
flower & bird adjustments for Nunavut, from pjanzen
2015-07-16 15:13:25 +00:00
otto
0731e9084c
/home/otto/ok
2015-06-26 19:18:03 +00:00
millert
637ecc7985
Fix sign compare bug introduced when rnum() was redefined to use
...
arc4random_uniform(). From pjanzen@, OK deraadt@
2015-05-20 20:26:00 +00:00
jmc
a29ad290e5
from snj, netbsd -r1.56: "properly pluralize"
2015-04-04 07:12:25 +00:00
jca
3965ecca3d
Fix double word in quote from Ken Olsen.
...
"There is no reason for any individual to have a computer in their home."
2015-03-25 12:54:13 +00:00
millert
78badebcb0
Eliminate use of TM_YEAR_BASE. OK guenther@ deraadt@ miod@
2015-03-17 19:31:30 +00:00
millert
f7055df57d
tzfile.h is an internal header that should never have been installed.
...
What's worse, the tzfile.h that gets installed is over 20 years old
and doesn't match the real tzfile.h in libc/time. This makes the
tree safe for /usr/include/tzfile.h removal. The TM_YEAR_BASE
define has been moved to time.h temporarily until its usage is
replaced by 1900 in the tree. Actual removal of tzfile.h is pending
a ports build. Based on a diff from deraadt@
2015-03-15 00:41:27 +00:00
jmc
0870f47d28
remove the first comma from constructs like ", and," and ", or,": you can use
...
"and" and "or" to join sentence clauses, and you can use commas, but both hinders
reading;
2015-03-13 19:58:40 +00:00
bentley
fb604f4523
Delete cribbage logging. Was never enabled and no point in enabling it.
...
ok tedu@
2015-03-12 02:19:10 +00:00
tedu
943007379d
make the worm grow faster on larger terminals. this is more fun than
...
starting with an enormous pile of worm at the start.
2015-03-09 19:52:02 +00:00
tedu
6e5a188a92
improve ship placement interface. per the instructions, 2468 should work,
...
but the first loop didn't allow them. also allow arrow keys to work, since
they work in other modes.
2015-02-18 23:41:31 +00:00
tedu
eb8dbf3e2d
no reason for magic numbers to be octal. just drop the leading 0.
...
still equally magic.
2015-02-18 23:20:45 +00:00
tedu
dff8a80e7e
don't cast function arguments; use reallocarray in one place
2015-02-18 23:16:08 +00:00
tedu
c38a25ace4
convert calloc/realloc pairs to reallocarray
2015-02-18 22:33:51 +00:00
bentley
947f4dd9ff
Don't abuse Aq for arguments, and use a prettier escape for dashes.
...
ok schwarze@
2015-02-18 02:16:59 +00:00
bentley
01a6998a3e
Mark up email addresses semantically with Mt.
...
ok schwarze@
2015-02-17 16:29:16 +00:00
tedu
87a184187f
the stem of the b was not descending all the way to the baseline.
...
now `/usr/games/banner libressl` is extra purty.
i should credit miod for reminding me of this program's existence
by requesting that i not paste its output into chat.
2015-02-10 13:50:58 +00:00
tedu
576f378f21
allow ctrl-d to quit after a game as well
2015-02-07 03:32:05 +00:00
tedu
24a46d3d9b
use unsigned char type to avoid many casts
2015-02-07 03:30:08 +00:00
tedu
f005acd6ef
by popular request, stop giving away numeric letters. no more will the
...
appearance of 509 in a symbol name tell you what letter to guess first.
2015-02-07 03:26:20 +00:00
tedu
b4acf7eded
unsigned char for ctype functions
2015-02-07 03:07:02 +00:00
miod
5af213f8f7
Ignore ELF symbols containing dots or dollar signs. Suggested by millert@
2015-02-07 02:56:00 +00:00
tedu
65b0e16c1a
clear to end of line when printing error messages so that previous
...
messages don't remain and pollute the line
2015-02-07 01:43:51 +00:00
miod
2ddfbac012
By popular demand, allow any ELF file to be passed to -d as a word list, in
...
which case its symbols will be used.
Which means that `hangman -k' is equivalent to `hangman -d /bsd' now.
ok beck@ tedu@
2015-02-07 01:37:30 +00:00
kspillner
31d0817b6d
Fix small typo found when testing tedu@'s fortune -o -m change.
...
ok jmc@
2015-02-06 20:00:55 +00:00
tedu
ff900ac7d5
unsigned char is the correct type for ctype functions
2015-02-06 10:50:48 +00:00
tedu
7a2625a8a8
no space after #
2015-02-06 10:49:32 +00:00
tedu
63bf18cd94
remove TRUE/FALSE in favor of the true boolean values 1/0
2015-02-06 10:46:52 +00:00
tedu
9c2c8654fd
Debug, whatever it's worth, is clearly not a boolean
2015-02-06 10:26:06 +00:00
tedu
a756941cbf
cleanup a few bits
2015-02-06 10:25:32 +00:00
tedu
14a0f98a66
remove no regex ifdef. everybody loves regex.
2015-02-06 10:18:51 +00:00
tedu
71165f8a54
use regcomp native case insensitive matching facility instead of
...
faking it poorly
2015-02-06 10:17:56 +00:00
tedu
d5d4835011
don't set a flag with ++; it's a bool, not a counter.
2015-02-06 10:12:57 +00:00
tedu
f48f70a6c8
change int to size_t to avoid integer overflow
2015-02-06 10:04:18 +00:00
tedu
3619beb36f
fix searching and display of offensive fortunes.
...
now, if you want to find an offensive fortune about (e.g.) meat,
you can simply run:
$ fortune -o -m meat
This is much easier than the previous requirement to run a command like:
$ fortune -o -m `echo meat | rot13` | rot13
requested by guenther phessler
2015-02-06 09:55:01 +00:00
tedu
d921930c11
regex are documented in re_format.7, not the C API in regex.3
2015-02-06 09:30:04 +00:00
krw
5f1af72573
Make some $OpenBSD$ lines prettier/standardier by eliminating
...
superflous '*' after '/*' and adding blank after terminating '$'.
Also eases parsing of the lines by simple awk scripts.
Aesthetic approval from tedu@.
2015-01-19 15:30:52 +00:00
deraadt
7accc80bcd
normalize formatting
2015-01-19 00:47:01 +00:00
schwarze
12bc606974
remove .Tn; from Jan Stary <hans at stare dot cz>
2015-01-15 19:06:31 +00:00
deraadt
0afc0f96b3
all modern systems can do this SUSPEND thing
2015-01-15 17:14:04 +00:00
deraadt
e432a80783
NR_OF_EOFS is a festering boil, lance & drain.
...
ok millert
2015-01-15 17:13:37 +00:00
tedu
1cc65eec88
adventure requires deterministic random for its internal data
...
"obfuscation" scheme to work (words fail me), but we can use arc4random
for the in game fun. from theo buehler
2014-12-31 15:45:57 +00:00
tedu
d71bc48f60
simplify poll() conversion. from patrick keshishian
2014-12-31 15:42:08 +00:00
jmc
a666d03438
spelling fix; from daria suchecka via krzystof warzecha
2014-12-28 21:07:41 +00:00
deraadt
cceea54a0e
Do not memorialize cheaters in the high score file.
...
from pjanzen
2014-12-09 05:01:14 +00:00
deraadt
f84032eda8
For now, these games still contain deterministic randomization (for
...
save / replay modes of operation that have not yet been cleaned up).
OK, I've let the cat out of the bag, now some of you know you can cheat
at them..
ok millert guenther tedu
2014-12-08 21:56:27 +00:00
tedu
0affe7fc21
okan noticed this was actually calling the cfree turd.
2014-12-08 21:11:02 +00:00
deraadt
7af8bc0b26
we do not use pcc on the vax
2014-12-07 21:06:57 +00:00
deraadt
9950ff4418
the debug / SVR4 chunk has been busted for a while. interesting.
...
from Jonas Termansen
2014-12-07 19:56:19 +00:00
jmc
17bed03ccd
removing the "rigged demo" quote, as it's also present in fortunes (1) file;
2014-12-07 08:47:22 +00:00
deraadt
89f61510a2
Remove SVR4 codeblock which insisted on using srand(time(0)) and rand().
...
How did this survive the tedu?? Very disappointed!!
2014-12-05 00:48:57 +00:00
deraadt
1e1477420a
Stop people from cheating. Especially those that believe in FIPS, they
...
are the worst.
ok millert ingo tedu
2014-12-04 06:12:33 +00:00
schwarze
6a52b24d9b
in the recent update of capitals, this critical file was forgotten
2014-12-03 00:04:54 +00:00
schwarze
5963cb8a8f
delete unused, almost empty file
2014-12-02 12:50:04 +00:00
schwarze
550d66d25a
get rid of line-printer-era backspace-encoding of diacriticals;
...
patch from pjanzen@; ok jmc@
2014-12-02 12:43:09 +00:00
schwarze
3430162862
Even though not callable, "Ed" is a macro name, so for clarity,
...
escape it when it appears on a macro line.
2014-11-30 02:41:43 +00:00
deraadt
62fc451f51
Adjust ordering; from pjanzen
2014-11-24 06:31:50 +00:00
deraadt
ec9f5c310e
Add two new IUPAC elements, and adjust the atomic weights of some.
...
from pjanzen
2014-11-24 06:31:23 +00:00
deraadt
190359872e
Update to gravely outdated places to visit, from Jack Szmidt
2014-11-22 20:06:27 +00:00
schwarze
928af296bb
minor tweaks and add HISTORY; ok jmc@
2014-11-20 01:35:47 +00:00
krw
fafc9fefb3
We don't need no stinkin' non-new-curses code. Also eliminates a
...
double #include.
ok deraadt@ tedu@
2014-11-19 18:55:09 +00:00
schwarze
dc238ad5f4
Bugfix: run for the specified number of seconds as described in the manual,
...
not for a fixed number of iterations. This makes a difference on terminals
not fast enough to update every second, in particular in -s mode.
Inspired by FreeBSD, but implemented differently with less bugs.
Patch from pjanzen@, slightly tweaked by me.
2014-11-19 03:27:45 +00:00
krw
14434de622
Nuke some obvious #include duplications.
...
ok espie@ deraadt@ millert@ tedu@
2014-11-18 20:51:00 +00:00
tedu
1b2da9231e
sigwinch support for resizing. from pjanzen
2014-11-18 20:09:45 +00:00
schwarze
7f2aa82d51
Center the clock. Based on an idea and an original diff from tedu@,
...
arithmetics and validity constraints fixed by me. OK pjanzen@ tedu@
2014-11-18 05:09:38 +00:00
schwarze
c4f20e92d7
HISTORY and AUTHORS; ok pjanzen@ mickey@
2014-11-18 02:25:12 +00:00
schwarze
35b20aedb4
Multiple improvements from pjanzen@:
...
* properly delay scrolling with nanosleep(2), relevant on fast terminals
* change timing to end scrolling on the second instead of starting it
* error out if the terminal is too small instead of garbling the output
* use strtonum(3) rather than strtol(3) and terminate error message with \n
2014-11-17 22:14:25 +00:00
guenther
053196f06f
Remove a bogotified comment
2014-11-16 04:50:46 +00:00
guenther
34278d36bd
Eliminate pointless use of <sys/param.h>, <sys/file.h>, <sys/sockio.h>,
...
and <sys/ttydefaults.h>
Replace MAXPATHLEN with PATH_MAX and MAXLOGNAME with LOGIN_NAME_MAX
Pull in <limits.h> where needed
Prefer sizeof(var) over MAXFOO or FOO_MAX
ok deraadt@
2014-11-16 04:49:48 +00:00
bentley
d01fe41759
Reduce instances of `` '' in manuals.
...
troff displays these as typographic quotes, but nroff implementations
almost always print them literally, which rarely has the intended effect
with modern fonts, even in stock xterm.
These uses of `` '' can be replaced either with more semantic alternatives
or with Dq, which prints typographic quotes in a UTF-8 locale (but will
automatically fall back to `` '' in an ASCII locale).
improvements and ok schwarze@
2014-11-15 14:41:01 +00:00
schwarze
0d300bcaaf
Split bcd(6), morse(6), and ppt(6) into three separate manuals
...
since most of the text is different.
Improve the SYNOPSIS according to suggestions by jmc@, tweaked by me.
Delete a few redundant words, applying a patch from jmc@.
Intentionally not doing any other text changes in this commit;
for further tweaking in the tree.
jmc@, tedu@, and millert@ agree with the general direction, and
deraadt@ suspects we are "all grey beard fanatics" (in all caps).
2014-11-07 22:17:49 +00:00
tedu
09d6f9ae6b
fixup argv handling after getopt conversion. oops.
2014-11-06 19:54:10 +00:00
tedu
e17bcdb243
-l option to create "modern" 80 column cards
2014-11-06 19:42:06 +00:00
tedu
05bf2a5dec
basic decode functionality
2014-11-06 19:35:13 +00:00
tedu
7215c05fc6
don't deref timeout if null. from theo buehler.
2014-11-05 20:23:38 +00:00
tedu
cc8a234a40
make the long line code work with argv too
2014-11-04 17:58:26 +00:00
tedu
1a508dba00
fix another signed char bug. while here, toupper() is now safe to call
...
on any char value.
2014-11-04 17:52:12 +00:00
tedu
50d1b26a76
allow printing longer lines than fit on a card by spilling onto more cards.
...
don't negatively index into the table for signed chars.
ok pjanzen
2014-11-04 17:50:23 +00:00
tedu
5d7c25f29f
use knuth shuffle for better distribution of permutations
2014-11-03 22:18:15 +00:00
deraadt
5e64005729
select() to poll() conversions
...
ok tedu (... other games maintainer absent)
2014-11-03 22:14:54 +00:00
tedu
a8ed32d4ad
the man page says it is impossible to cheat, but since the shuffle is
...
lopsided, a sharp counter can detect uneven permutations. fix this by
using knuth shuffle.
ok mlarkin pjanzen
2014-11-03 19:18:16 +00:00