summaryrefslogtreecommitdiff
path: root/scripts/lxdialog/msgbox.c
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lxdialog/msgbox.c')
-rw-r--r--scripts/lxdialog/msgbox.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/scripts/lxdialog/msgbox.c b/scripts/lxdialog/msgbox.c
index b39405717da1..7323f5471f69 100644
--- a/scripts/lxdialog/msgbox.c
+++ b/scripts/lxdialog/msgbox.c
@@ -42,20 +42,8 @@ int dialog_msgbox(const char *title, const char *prompt, int height, int width,
draw_box(dialog, 0, 0, height, width, dialog_attr, border_attr);
- if (title != NULL && strlen(title) >= width - 2) {
- /* truncate long title -- mec */
- char *title2 = malloc(width - 2 + 1);
- memcpy(title2, title, width - 2);
- title2[width - 2] = '\0';
- title = title2;
- }
+ print_title(dialog, title, width);
- if (title != NULL) {
- wattrset(dialog, title_attr);
- mvwaddch(dialog, 0, (width - strlen(title)) / 2 - 1, ' ');
- waddstr(dialog, (char *)title);
- waddch(dialog, ' ');
- }
wattrset(dialog, dialog_attr);
print_autowrap(dialog, prompt, width - 2, 1, 2);