summaryrefslogtreecommitdiffstats
path: root/scripts/lxdialog/inputbox.c
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lxdialog/inputbox.c')
-rw-r--r--scripts/lxdialog/inputbox.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/scripts/lxdialog/inputbox.c b/scripts/lxdialog/inputbox.c
index bc135c7..7795037 100644
--- a/scripts/lxdialog/inputbox.c
+++ b/scripts/lxdialog/inputbox.c
@@ -66,20 +66,7 @@ int dialog_inputbox(const char *title, const char *prompt, int height, int width
wattrset(dialog, dialog_attr);
waddch(dialog, ACS_RTEE);
- 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;
- }
-
- if (title != NULL) {
- wattrset(dialog, title_attr);
- mvwaddch(dialog, 0, (width - strlen(title)) / 2 - 1, ' ');
- waddstr(dialog, (char *)title);
- waddch(dialog, ' ');
- }
+ print_title(dialog, title, width);
wattrset(dialog, dialog_attr);
print_autowrap(dialog, prompt, width - 2, 1, 3);
OpenPOWER on IntegriCloud