Add Farberisms from Prof. Dave Farber.
From: David Farber <dave@farber.net>
To: proff@iq.org (Julian Assange)
Date: Sat, 20 Oct 2001 03:29:08 -0400
Subject: Re: farberisms
Fine with me
At 02:27 PM 10/20/2001 +1000, you wrote:
>Hi Dave,
>
>I've just come accross your list of `Farberisms', which had me in
>stiches. As these are deliciously `fortune'esqe, I'd like to add
>them to the NetBSD distribution. Do you have any objections?
>
>Cheers,
>Julian.
Make sure that each va_start has one and only one matching va_end,
especially in error cases.
If the va_list is used multiple times, do multiple va_starts/va_ends.
If a function gets va_list as argument, don't let it use va_end (since
it's the callers responsibility).
Improved by comments from enami and christos -- thanks!
Heimdal/krb4/KAME changes already fed back, rest to follow.
Inspired by, but not not based on, OpenBSD.
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".
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.