diff options
Diffstat (limited to 'scripts/lxdialog/checklist.c')
-rw-r--r-- | scripts/lxdialog/checklist.c | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/scripts/lxdialog/checklist.c b/scripts/lxdialog/checklist.c index ae40a2b3b885..3fb681fb9632 100644 --- a/scripts/lxdialog/checklist.c +++ b/scripts/lxdialog/checklist.c | |||
@@ -158,20 +158,7 @@ int dialog_checklist(const char *title, const char *prompt, int height, | |||
158 | wattrset(dialog, dialog_attr); | 158 | wattrset(dialog, dialog_attr); |
159 | waddch(dialog, ACS_RTEE); | 159 | waddch(dialog, ACS_RTEE); |
160 | 160 | ||
161 | if (title != NULL && strlen(title) >= width - 2) { | 161 | print_title(dialog, title, width); |
162 | /* truncate long title -- mec */ | ||
163 | char *title2 = malloc(width - 2 + 1); | ||
164 | memcpy(title2, title, width - 2); | ||
165 | title2[width - 2] = '\0'; | ||
166 | title = title2; | ||
167 | } | ||
168 | |||
169 | if (title != NULL) { | ||
170 | wattrset(dialog, title_attr); | ||
171 | mvwaddch(dialog, 0, (width - strlen(title)) / 2 - 1, ' '); | ||
172 | waddstr(dialog, (char *)title); | ||
173 | waddch(dialog, ' '); | ||
174 | } | ||
175 | 162 | ||
176 | wattrset(dialog, dialog_attr); | 163 | wattrset(dialog, dialog_attr); |
177 | print_autowrap(dialog, prompt, width - 2, 1, 3); | 164 | print_autowrap(dialog, prompt, width - 2, 1, 3); |