diff options
author | billf <billf@FreeBSD.org> | 1999-07-23 21:31:08 +0000 |
---|---|---|
committer | billf <billf@FreeBSD.org> | 1999-07-23 21:31:08 +0000 |
commit | cd63cca3b974b6f6a814416f34b72d81d408c1ae (patch) | |
tree | 32f985d3c462e7a95ea7cee715476d23134699da | |
parent | aa93e6cc7f601a09a6bd74505988524619e53948 (diff) | |
download | FreeBSD-src-cd63cca3b974b6f6a814416f34b72d81d408c1ae.zip FreeBSD-src-cd63cca3b974b6f6a814416f34b72d81d408c1ae.tar.gz |
(1) Avoid ambigous if/else
PR: bin/12768
Submitted By: Stephen J. Roznowski <sjr@home.net>
(2) Follow KNF
-rw-r--r-- | games/fortune/fortune/fortune.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/games/fortune/fortune/fortune.c b/games/fortune/fortune/fortune.c index d06ceda..854a644 100644 --- a/games/fortune/fortune/fortune.c +++ b/games/fortune/fortune/fortune.c @@ -401,7 +401,7 @@ register int file_cnt; register int i, percent; register char *sp; - if (file_cnt == 0) + if (file_cnt == 0) { if (Find_files) { Fortunes_only = TRUE; i = add_file(NO_PROB, FORTDIR, NULL, &File_list, @@ -411,6 +411,7 @@ register int file_cnt; } else return add_file(NO_PROB, "fortunes", FORTDIR, &File_list, &File_tail, NULL); + } for (i = 0; i < file_cnt; i++) { percent = NO_PROB; if (!isdigit((unsigned char)files[i][0])) @@ -918,7 +919,7 @@ init_prob() exit(1); } percent = 100 - percent; - if (Equal_probs) + if (Equal_probs) { if (num_noprob != 0) { if (num_noprob > 1) { frac = percent / num_noprob; @@ -932,7 +933,7 @@ init_prob() last->percent = percent; DPRINTF(1, (stderr, ", residual = %d%%", percent)); } - else { + else DPRINTF(1, (stderr, ", %d%% distributed over remaining fortunes\n", percent)); |