summaryrefslogtreecommitdiffstats
path: root/fortune/fortune/fortune.c
Commit message (Collapse)AuthorAgeFilesLines
* Get all the games compiling for iOSCameron Katri2021-02-221-1353/+0
|
* fortune: arc4random_uniform for better uniform values than random() % ...nia2020-07-211-15/+8
|
* WARNS=5, and make WARNS=5 the default for src/games.dholland2012-06-191-4/+3
|
* Close two file descriptors after using them. Found by cppcheck.wiz2010-01-171-2/+4
|
* Instead of trying to cons up a regexp that ignores case, use REG_ICASE.dholland2009-08-271-51/+13
| | | This makes fortune -im work; it's been broken since whenever.
* Tidy up regexp handling further.dholland2009-08-271-37/+62
|
* Prune conditional compilation for using obsolete regexp libraries.dholland2009-08-271-42/+24
|
* Whitespace.dholland2009-08-271-127/+128
|
* Prevent nasal demons in a case I spotted while preparing the previous.dholland2009-08-271-3/+3
|
* ANSIfy function definitions.dholland2009-08-271-78/+40
|
* Sprinkle some size_t in places where it's better than int.dholland2009-08-271-11/+11
| | | (Reduces casts.)
* remove more unnecessary castsdholland2009-08-271-5/+5
|
* Use correct type for malloc sizes (size_t, not unsigned)dholland2009-08-271-7/+6
|
* remove unnecessary castsdholland2009-08-271-5/+5
|
* sprinkle staticdholland2009-08-121-92/+91
|
* Remove the \n and tabs from the __COPYRIGHT() strings.lukem2008-07-201-4/+4
|
* convert __attribute__s to applicable cdefs.h macrosperry2007-12-151-4/+4
|
* Coverity CID 3269: Fix memory leak.christos2006-05-131-5/+8
|
* Coverity CID 2735: Remove dead code.christos2006-03-211-4/+2
|
* Coverity CID 827: Prevent NULL pointer deref.christos2006-03-181-3/+3
|
* Coverity CID 1699: Fix memory leaks.christos2006-03-181-12/+21
|
* Coverity CID 2544: Fix memory leak.christos2006-03-181-12/+17
|
* Add (unsigned char) cast to ctype functionsdsl2004-11-051-11/+11
|
* Remove uses of __P.jsm2004-01-271-38/+38
|
* Include <sys/endian.h>.jsm2004-01-271-2/+3
|
* Return proper fortune length from fortlen for fortune files withoutjsm2004-01-011-3/+3
| | | | STR_RANDOM or STR_ORDERED rather than comparing it to SLEN. Bug reported by Simon Williams <simon@no-dns-yet.org.uk>.
* Show residual probability rather than non-residual in "No place to putjsm2004-01-011-4/+4
| | | | | residual probability" error message. Distribute residual probability correctly rather than all to one file. Patch from Mike Castle <dalgoda@ix.netcom.com>.
* Move UCB-licensed code from 4-clause to 3-clause licence.agc2003-08-071-7/+3
| | | Patches provided by Joel Baker in PR 22269, verified by myself.
* Fix bogon in compat re code.christos2002-11-241-5/+7
|
* sweep of errx/warnx, remove unnecessary trailing \ngrant2002-07-201-3/+3
|
* backout previous (arc4random), per request from sommerfelditojun2002-07-011-8/+15
|
* use arc4randomitojun2002-07-011-15/+8
|
* PR/15878: Ed Ravin: fortune all frees junk pointers. Fixed, free structurechristos2002-03-121-3/+3
| | | members before freeing the structure itself.
* Sync getopt() / man page with actual getopt options.soren2001-12-201-3/+3
|
* Undo indentation glitch in previous.wiz2001-10-281-4/+4
|
* improve random number seedingproff2001-10-281-5/+12
|
* Change -a to mean all files, as opposed to just a few more files.atatat2001-08-151-43/+71
| | | | | | | | | | | | | | | | Modify the regex handling so that we can match fortunes in rot13'ed databases (rot13 the pattern and maintain a second compiled pattern) and rot13 the rot13'ed fortune before output. Move the rot13 code to a function since it's now used in three places instead of just one. Initialize posfile in one place since it appears to get used without being initialized when using debugging. Make a *slight* improvement to the random seeding by squaring the pid and then xor'ing against the current time, since just xor'ing the time with the pid will not change if they both advance by one from "odd" to "even".
* Overhaul error handling and reporting for regular expressions.christos2001-06-041-15/+22
| | | | | Provide a RE_OK() macro that tests if the current compiled pattern works and a RE_ERROR() macro that prints what went wrong as well as the particular RE implementation can handle.
* Bail out when regex pattern is invalid if using regcomp or regcmp.aymeric2001-06-041-7/+7
| | | | | Remove trailing \n's also. Addresses PR#13109
* convert to use getprogname()cgd2001-02-191-5/+4
|
* fix nested extern and usage messagechristos2001-02-051-4/+5
|
* use more standard %ll_ in favour of %q_lukem2001-01-041-3/+4
|
* fix a bug in the call to srandom(): xor time() with getpid(), don't add them!mrg2000-10-311-3/+3
| | | | now fortune(6) run in an unending loop does not appear to show the same fortunes over and over and over.
* Don't declare 'extern opt*' getopt variables.simonb2000-04-141-4/+2
|
* Since our gcc doesn't warn about NULL format strings anymore, we candrochner1999-11-091-5/+5
| | | | fix the incorrect err(1, "%s", "") et al. Closes PR bin/7592 by cgd.
* Use macro NAMLEN rather than dirent->d_namlen, for easier portability.jsm1999-09-221-4/+8
|
* Fix -Wsign-compare warnings.jsm1999-09-181-6/+6
|
* Include <time.h> in various places in the games where time() or time_tjsm1999-09-091-2/+3
| | | are used.
* Use the symbolic names `SEEK_SET' and `O_RDONLY' where appropriate injsm1999-09-081-5/+5
| | | the games.
* Add `__noreturn__' and `__unused__' attributes where appropriate tojsm1999-09-081-3/+7
| | | | | | | | | | | | 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).