|
@@ -307,6 +307,7 @@ int show_menu ( struct menu *menu, unsigned int timeout_ms,
|
307
|
307
|
const char *select, struct menu_item **selected ) {
|
308
|
308
|
struct menu_item *item;
|
309
|
309
|
struct menu_ui ui;
|
|
310
|
+ char buf[ MENU_COLS + 1 /* NUL */ ];
|
310
|
311
|
int labelled_count = 0;
|
311
|
312
|
int rc;
|
312
|
313
|
|
|
@@ -348,8 +349,8 @@ int show_menu ( struct menu *menu, unsigned int timeout_ms,
|
348
|
349
|
|
349
|
350
|
/* Draw initial content */
|
350
|
351
|
attron ( A_BOLD );
|
351
|
|
- mvprintw ( TITLE_ROW, ( ( COLS - strlen ( ui.menu->title ) ) / 2 ),
|
352
|
|
- "%s", ui.menu->title );
|
|
352
|
+ snprintf ( buf, sizeof ( buf ), "%s", ui.menu->title );
|
|
353
|
+ mvprintw ( TITLE_ROW, ( ( COLS - strlen ( buf ) ) / 2 ), "%s", buf );
|
353
|
354
|
attroff ( A_BOLD );
|
354
|
355
|
draw_menu_items ( &ui );
|
355
|
356
|
draw_menu_item ( &ui, ui.selected );
|