summaryrefslogtreecommitdiffstats
path: root/disk-utils/cfdisk.c
diff options
context:
space:
mode:
authorKarel Zak2014-07-15 12:32:38 +0200
committerKarel Zak2014-07-15 12:32:38 +0200
commit8fc37981cf15868c70d58594c4878e73283e3155 (patch)
tree398f3b3dce8b4b58402190cb44d4acec83735e05 /disk-utils/cfdisk.c
parentlibfdisk: make disk sync() optional (diff)
downloadkernel-qcow2-util-linux-8fc37981cf15868c70d58594c4878e73283e3155.tar.gz
kernel-qcow2-util-linux-8fc37981cf15868c70d58594c4878e73283e3155.tar.xz
kernel-qcow2-util-linux-8fc37981cf15868c70d58594c4878e73283e3155.zip
cfdisk: use \n for messages on stdout and stderr
Reported-by: Benno Schulenberg <bensberg@justemail.net> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'disk-utils/cfdisk.c')
-rw-r--r--disk-utils/cfdisk.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/disk-utils/cfdisk.c b/disk-utils/cfdisk.c
index 8a627e52e..17a3bc415 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);
}