summaryrefslogtreecommitdiff
path: root/games/fortune
AgeCommit message (Collapse)Author
2016-01-07Some basic code maintenance in games/tb
- 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-04More headers removal and sorted the remaining alphabetically.mestre
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-03About 13 years ago when the idiom srandom(time()), and sometimesmestre
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@
2015-12-28update the us army democracy excerpt to more closelyJason McIntyre
match the format of the original; from andre smagin
2015-12-28andy finkel confimed himself as the originator of the rigged demo quote;Jason McIntyre
from netbsd pr 49451
2015-12-25Declare usage() functions as __dead void, if they don't return, on games ↵mestre
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-11-15fix a double space issue in the following, rather wonderful, fortune:Jason McIntyre
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-10another open(path, 0)...Theo de Raadt
2015-11-10pledge "stdio rpath" at the top. (Ricardo's 2nd chunk which reducesTheo de Raadt
further is not placed right, so I ignored it for now) from Ricardo Mestre
2015-11-10replace open(path, 0) with open(path, O_RDONLY). amazing to still findTheo de Raadt
sloppiness like this.
2015-10-24Cast ctype functions' argument to unsigned char.mmcc
ok guenther@
2015-10-24Cast isdigit()'s argument to unsigned char.mmcc
ok guenther@
2015-09-25use | rather than / for alternatives and some macro fixesIngo Schwarze
2015-09-16big blocks need braces for supportTed Unangst
2015-08-26remove #ifdef OK_TO_WRITE_DISK which isn't used by default.Sebastien Marie
and few disambiguisations suggested by cc(1) - parentheses around && within || - explicit braces to avoid ambiguous 'else' ok doug@
2015-04-04from snj, netbsd -r1.56: "properly pluralize"Jason McIntyre
2015-03-25Fix double word in quote from Ken Olsen.Jeremie Courreges-Anglas
"There is no reason for any individual to have a computer in their home."
2015-02-06Fix small typo found when testing tedu@'s fortune -o -m change.Kent R. Spillner
ok jmc@
2015-02-06unsigned char is the correct type for ctype functionsTed Unangst
2015-02-06no space after #Ted Unangst
2015-02-06remove TRUE/FALSE in favor of the true boolean values 1/0Ted Unangst
2015-02-06Debug, whatever it's worth, is clearly not a booleanTed Unangst
2015-02-06cleanup a few bitsTed Unangst
2015-02-06remove no regex ifdef. everybody loves regex.Ted Unangst
2015-02-06use regcomp native case insensitive matching facility instead ofTed Unangst
faking it poorly
2015-02-06don't set a flag with ++; it's a bool, not a counter.Ted Unangst
2015-02-06change int to size_t to avoid integer overflowTed Unangst
2015-02-06fix searching and display of offensive fortunes.Ted Unangst
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-06regex are documented in re_format.7, not the C API in regex.3Ted Unangst
2014-12-07removing the "rigged demo" quote, as it's also present in fortunes (1) file;Jason McIntyre
2014-11-16Eliminate pointless use of <sys/param.h>, <sys/file.h>, <sys/sockio.h>,Philip Guenther
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-10-11Userland reallocarray() audit.Doug Hogan
Avoid potential integer overflow in the size argument of malloc() and realloc() by using reallocarray() to avoid unchecked multiplication. ok deraadt@
2014-07-01Fix typo in Hoare quotePhilip Guenther
2014-03-30typo fix From: Josh Grosse;Jason McIntyre
2014-02-16malcolm macdougall, not dacdougall;Jason McIntyre
From: Joe Marcus Clarke
2014-01-11optarg/optind are declared in <unistd.h>, so kill the externs herePhilip Guenther
2013-12-11typo fix from gavin atkinson, freebsd -r259189;Jason McIntyre
2013-08-29replace srandomdev()+random() with the arc4random*() familyChristian Weisgerber
tweaks and ok millert@, ok deraadt@
2013-08-22Correct format string mismatches turned up by -Wformat=2Philip Guenther
suggestions and ok millert@
2013-08-14no longer any need to quote macro lines with >9 args;Jason McIntyre
From: Jan Stary
2013-05-09teenagers from *outer* space ("they blast the flesh off hunmans!");Jason McIntyre
2013-02-18typo fix; from pgoyette, netbsd -r1.15 and -r1.11, respectively;Jason McIntyre
2013-02-10typo; fix from patrick keshishianJason McIntyre
2012-11-24grammar fix; from Chris Petrik, freebsd pr 173868Jason McIntyre
2012-11-17pjanzen spotted that my previous commit mistakenly omitted anotherJason McIntyre
spelling fix;
2012-11-16two spelling fixes; from John-Mark Gurney (freebsd -r243048);Jason McIntyre
2012-06-20typo; netbsd -r1.10Jason McIntyre
2012-05-24typosMiod Vallat
2011-12-04Fix grammar and spelling in a Latin fortune.Pascal Stumpf
ok jmc@
2011-11-20grammar fix, from jnemeth@netbsd (-r1.48);Jason McIntyre