Skip to content

Commit eafc628

Browse files
elboulangeropoettering
authored andcommitted
Fix uninitialized variable in log_fullv
If format already ends with '\n', then fmt was not initialized, and used all the same. Funny that the compiler didn't catch it. Signed-off-by: Arnaud Rebillout <[email protected]>
1 parent a3a7419 commit eafc628

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/log.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ static int log_fullv(
7272
if (level > get_log_level())
7373
return -abs(error);
7474

75-
if (!endswith(format, "\n"))
75+
if (endswith(format, "\n"))
76+
fmt = format;
77+
else
7678
fmt = strjoina(format, "\n");
7779

7880
if (error != 0)

0 commit comments

Comments
 (0)