diff options
author | Sam Ravnborg <sam@mars.ravnborg.org> | 2005-11-19 23:38:06 +0100 |
---|---|---|
committer | Sam Ravnborg <sam@mars.ravnborg.org> | 2005-11-19 23:38:06 +0100 |
commit | fa7009d5b59b8acd8071f7b3057d36eeeaf08146 (patch) | |
tree | ba88e9f448aed4c047d8ce311ba44c8731ee96c2 /scripts/lxdialog/yesno.c | |
parent | kconfig: lxdialog is now sparse clean (diff) | |
download | linux-fa7009d5b59b8acd8071f7b3057d36eeeaf08146.tar.xz linux-fa7009d5b59b8acd8071f7b3057d36eeeaf08146.zip |
kconfig: Add print_title helper in lxdialog
Simplify check for long title and use a helper function in util.c
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to '')
-rw-r--r-- | scripts/lxdialog/yesno.c | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/scripts/lxdialog/yesno.c b/scripts/lxdialog/yesno.c index 84f3e8e005e4..cb2568aae3ed 100644 --- a/scripts/lxdialog/yesno.c +++ b/scripts/lxdialog/yesno.c @@ -61,20 +61,7 @@ int dialog_yesno(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); |