#include <string.h>
#include <stdlib.h>
+#include <assert.h>
#include "abook_curses.h"
#include "ui.h"
#include "abook.h"
WINDOW *editw;
static void
-editor_tab(int tab)
+editor_tab(const int tab)
{
int i;
- int spacing = 12;
- char *tab_names[] = {
+ const int spacing = 12;
+ static char *tab_names[] = {
"CONTACT",
"ADDRESS",
" PHONE ",
else
snprintf(header, EDITW_COLS, "%s", database[item][NAME]);
- mvwaddstr(editw, 0, (EDITW_COLS - strlen(header)) / 2,
+ mvwaddstr(editw, 0, (EDITW_COLS - strwidth(header)) / 2,
header);
free(header);
my_free(backup);
}
break;
+ default:
+ assert(0);
}
}
case 'a': tab = TAB_ADDRESS; break;
case 'p': tab = TAB_PHONE; break;
case 'o': tab = TAB_OTHER; break;
+ case 'C': tab = TAB_CUSTOM; break;
case 'h':
case KEY_LEFT: tab = tab == 0 ? MAX_TAB : tab - 1;
break;