diff --git a/zipl/boot/libc.c b/zipl/boot/libc.c index 004a0a55..4db5bab7 100644 --- a/zipl/boot/libc.c +++ b/zipl/boot/libc.c @@ -410,11 +410,17 @@ void snprintf(char *buf, unsigned long size, const char *fmt, ...) */ void printf(const char *fmt, ...) { - char buf[81]; + char buf[LINE_LENGTH + 1]; + int len; va_list va; va_start(va, fmt); - vsnprintf(buf, sizeof(buf), fmt, va); + len = vsnprintf(buf, sizeof(buf), fmt, va); + if (len > LINE_LENGTH) { + buf[LINE_LENGTH - 1] = '.'; + buf[LINE_LENGTH - 2] = '.'; + buf[LINE_LENGTH - 3] = '.'; + } sclp_print(buf); va_end(va); } diff --git a/zipl/boot/libc.h b/zipl/boot/libc.h index 8b0639ed..83ff82bc 100644 --- a/zipl/boot/libc.h +++ b/zipl/boot/libc.h @@ -42,6 +42,7 @@ #define ENOTTY 25 /* Not a typewriter */ #define MIB (1024ULL * 1024) +#define LINE_LENGTH 80 /* max line length printed by printf */ void printf(const char *, ...); void snprintf(char *buf, unsigned long size, const char *fmt, ...); diff --git a/zipl/boot/menu.h b/zipl/boot/menu.h index 1b103a85..ee0f2c5f 100644 --- a/zipl/boot/menu.h +++ b/zipl/boot/menu.h @@ -20,7 +20,6 @@ /* max command line length */ #define COMMAND_LINE_SIZE 896 #define BOOT_MENU_ENTRIES 63 -#define LINE_LENGTH 80 #define PARAM_SIZE 8 #define TEXT_OFFSET 4