aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/lxdialog/textbox.c
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lxdialog/textbox.c')
-rw-r--r--scripts/lxdialog/textbox.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/scripts/lxdialog/textbox.c b/scripts/lxdialog/textbox.c
index fa8d92ea02b6..77848bb8e07f 100644
--- a/scripts/lxdialog/textbox.c
+++ b/scripts/lxdialog/textbox.c
@@ -103,20 +103,8 @@ int dialog_textbox(const char *title, const char *file, int height, int width)
103 wbkgdset(dialog, dialog_attr & A_COLOR); 103 wbkgdset(dialog, dialog_attr & A_COLOR);
104 waddch(dialog, ACS_RTEE); 104 waddch(dialog, ACS_RTEE);
105 105
106 if (title != NULL && strlen(title) >= width - 2) { 106 print_title(dialog, title, width);
107 /* truncate long title -- mec */
108 char *title2 = malloc(width - 2 + 1);
109 memcpy(title2, title, width - 2);
110 title2[width - 2] = '\0';
111 title = title2;
112 }
113 107
114 if (title != NULL) {
115 wattrset(dialog, title_attr);
116 mvwaddch(dialog, 0, (width - strlen(title)) / 2 - 1, ' ');
117 waddstr(dialog, (char *)title);
118 waddch(dialog, ' ');
119 }
120 print_button(dialog, " Exit ", height - 2, width / 2 - 4, TRUE); 108 print_button(dialog, " Exit ", height - 2, width / 2 - 4, TRUE);
121 wnoutrefresh(dialog); 109 wnoutrefresh(dialog);
122 getyx(dialog, cur_y, cur_x); /* Save cursor position */ 110 getyx(dialog, cur_y, cur_x); /* Save cursor position */