From: Karel Zak Date: Tue, 15 Jul 2014 10:32:38 +0000 (+0200) Subject: cfdisk: use \n for messages on stdout and stderr X-Git-Tag: v2.25~67 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8fc37981cf15868c70d58594c4878e73283e3155;p=thirdparty%2Futil-linux.git cfdisk: use \n for messages on stdout and stderr Reported-by: Benno Schulenberg Signed-off-by: Karel Zak --- diff --git a/disk-utils/cfdisk.c b/disk-utils/cfdisk.c index 8a627e52e4..17a3bc4151 100644 --- a/disk-utils/cfdisk.c +++ b/disk-utils/cfdisk.c @@ -552,8 +552,10 @@ static void ui_warnx(const char *fmt, ...) ui_vprint_center(INFO_LINE, colors_wanted() ? COLOR_PAIR(CFDISK_CL_WARNING) : 0, fmt, ap); - else + else { vfprintf(stderr, fmt, ap); + fputc('\n', stderr); + } va_end(ap); } @@ -569,8 +571,10 @@ static void ui_warn(const char *fmt, ...) ui_vprint_center(INFO_LINE, colors_wanted() ? COLOR_PAIR(CFDISK_CL_WARNING) : 0, fmt_m, ap); - else + else { vfprintf(stderr, fmt_m, ap); + fputc('\n', stderr); + } va_end(ap); free(fmt_m); } @@ -583,6 +587,7 @@ static int __attribute__((__noreturn__)) ui_errx(int rc, const char *fmt, ...) va_start(ap, fmt); fprintf(stderr, "%s: ", program_invocation_short_name); vfprintf(stderr, fmt, ap); + fputc('\n', stderr); va_end(ap); exit(rc); @@ -594,8 +599,10 @@ static void ui_info(const char *fmt, ...) va_start(ap, fmt); if (ui_enabled) ui_vprint_center(INFO_LINE, A_BOLD, fmt, ap); - else + else { vfprintf(stdout, fmt, ap); + fputc('\n', stdout); + } va_end(ap); } @@ -611,8 +618,10 @@ static void ui_hint(const char *fmt, ...) va_start(ap, fmt); if (ui_enabled) ui_vprint_center(HINT_LINE, A_BOLD, fmt, ap); - else + else { vfprintf(stdout, fmt, ap); + fputc('\n', stdout); + } va_end(ap); }