summaryrefslogtreecommitdiffstats
path: root/fortune/fortune
diff options
context:
space:
mode:
authorjsm <jsm@NetBSD.org>2004-01-01 16:01:25 +0000
committerjsm <jsm@NetBSD.org>2004-01-01 16:01:25 +0000
commit6183761dd72b608ed95527c5ffc5de85f73a9560 (patch)
tree648475e4cb0c80ef5bb35178d86049ad9effc5d0 /fortune/fortune
parent3c771c64160feb37f6e52f67b3c6539b7c5e7a1b (diff)
downloadbsdgames-darwin-6183761dd72b608ed95527c5ffc5de85f73a9560.tar.gz
bsdgames-darwin-6183761dd72b608ed95527c5ffc5de85f73a9560.tar.zst
bsdgames-darwin-6183761dd72b608ed95527c5ffc5de85f73a9560.zip
Show residual probability rather than non-residual in "No place to put
residual probability" error message. Distribute residual probability correctly rather than all to one file. Patch from Mike Castle <dalgoda@ix.netcom.com>.
Diffstat (limited to 'fortune/fortune')
-rw-r--r--fortune/fortune/fortune.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fortune/fortune/fortune.c b/fortune/fortune/fortune.c
index 4ae96388..117f9e03 100644
--- a/fortune/fortune/fortune.c
+++ b/fortune/fortune/fortune.c
@@ -1,4 +1,4 @@
-/* $NetBSD: fortune.c,v 1.39 2003/08/07 09:37:14 agc Exp $ */
+/* $NetBSD: fortune.c,v 1.40 2004/01/01 16:01:25 jsm Exp $ */
/*-
* Copyright (c) 1986, 1993
@@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1986, 1993\n\
#if 0
static char sccsid[] = "@(#)fortune.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: fortune.c,v 1.39 2003/08/07 09:37:14 agc Exp $");
+__RCSID("$NetBSD: fortune.c,v 1.40 2004/01/01 16:01:25 jsm Exp $");
#endif
#endif /* not lint */
@@ -935,7 +935,7 @@ init_prob()
errx(1, "Probabilities sum to %d%%!", percent);
else if (percent < 100 && num_noprob == 0)
errx(1, "No place to put residual probability (%d%%)",
- percent);
+ 100 - percent);
else if (percent == 100 && num_noprob != 0)
errx(1, "No probability left to put in residual files");
percent = 100 - percent;
@@ -944,7 +944,7 @@ init_prob()
if (num_noprob > 1) {
frac = percent / num_noprob;
DPRINTF(1, (stderr, ", frac = %d%%", frac));
- for (fp = File_list; fp != last; fp = fp->next)
+ for (fp = File_tail; fp != last; fp = fp->prev)
if (fp->percent == NO_PROB) {
fp->percent = frac;
percent -= frac;