Commit 35a11506 authored by Kent Overstreet's avatar Kent Overstreet
Browse files

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: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 3c72d3ee
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -270,7 +270,7 @@ static void __bch2_print_string_as_lines(const char *prefix, const char *lines,
		locked = console_trylock();
	}

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