diff options
-rw-r--r-- | fortune/fortune/fortune.c | 8 |
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; |