Skip to content

Commit 35a1150

Browse files
author
Kent Overstreet
committed
bcachefs: print_string_as_lines: fix extra newline
Don't print a newline on empty string; this was causing us to also print an extra newline when we got to the end of th string. Signed-off-by: Kent Overstreet <[email protected]>
1 parent 3c72d3e commit 35a1150

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/bcachefs/util.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ static void __bch2_print_string_as_lines(const char *prefix, const char *lines,
270270
locked = console_trylock();
271271
}
272272

273-
while (1) {
273+
while (*lines) {
274274
p = strchrnul(lines, '\n');
275275
printk("%s%.*s\n", prefix, (int) (p - lines), lines);
276276
if (!*p)

0 commit comments

Comments
 (0)