Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Oct 2022 23:11:22 GMT
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: db695788fc3d - main - fortune: Unindent a debug printf in get_fort().
Message-ID:  <202210032311.293NBMQ3065617@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=db695788fc3d1eb3ff4cb258710f874953324208

commit db695788fc3d1eb3ff4cb258710f874953324208
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2022-10-03 23:10:42 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2022-10-03 23:10:42 +0000

    fortune: Unindent a debug printf in get_fort().
    
    The debug printf is intended to execute after the loop has ended to
    log the selected file.
    
    Reviewed by:    imp, emaste
    Reported by:    GCC
    Differential Revision:  https://reviews.freebsd.org/D36815
---
 usr.bin/fortune/fortune/fortune.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/usr.bin/fortune/fortune/fortune.c b/usr.bin/fortune/fortune/fortune.c
index f375ec645ede..0a49c3229077 100644
--- a/usr.bin/fortune/fortune/fortune.c
+++ b/usr.bin/fortune/fortune/fortune.c
@@ -958,7 +958,7 @@ get_fort(void)
 	else {
 		choice = arc4random_uniform(100);
 		DPRINTF(1, (stderr, "choice = %d\n", choice));
-		for (fp = File_list; fp->percent != NO_PROB; fp = fp->next)
+		for (fp = File_list; fp->percent != NO_PROB; fp = fp->next) {
 			if (choice < fp->percent)
 				break;
 			else {
@@ -967,9 +967,10 @@ get_fort(void)
 					    "    skip \"%s\", %d%% (choice = %d)\n",
 					    fp->name, fp->percent, choice));
 			}
-			DPRINTF(1, (stderr,
-				    "using \"%s\", %d%% (choice = %d)\n",
-				    fp->name, fp->percent, choice));
+		}
+		DPRINTF(1, (stderr,
+			    "using \"%s\", %d%% (choice = %d)\n",
+			    fp->name, fp->percent, choice));
 	}
 	if (fp->percent != NO_PROB)
 		get_tbl(fp);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202210032311.293NBMQ3065617>