From 444924ca8f258c2089258aa01a410a65b2b9bf0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABl=20PORTAY?= Date: Thu, 23 Jun 2022 11:58:38 +0200 Subject: [PATCH] error: fix newline The end-of-line character is output if the errnum is nonezero only. This commit fixes the behaviour[1] by reducing the scope for the instruction that print the end-of-line character. [1]: http://refspecs.linux-foundation.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/baselib-error-n.html --- libgcompat/error.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libgcompat/error.c b/libgcompat/error.c index c759b19..92ce224 100644 --- a/libgcompat/error.c +++ b/libgcompat/error.c @@ -22,6 +22,6 @@ void error(int status, int errnum, const char *format, ...) if (errnum != 0) { fputs(": ", stderr); fputs(strerror(errnum), stderr); - fputc('\n', stderr); } + fputc('\n', stderr); } -- GitLab