X-Git-Url: https://git.deb.at/w?a=blobdiff_plain;f=edit.c;h=8a2e1e98f247f28fbd1068fc7f99cbbedb8cfaa8;hb=64990eb83b3bab7df8784b6ac1ef540016070e49;hp=8d39660156e90ca5ce884e8ba7b1080019e9f6ce;hpb=35c85955699b227956e399a76b4a78ab48aa0c18;p=pkg%2Fabook.git diff --git a/edit.c b/edit.c index 8d39660..8a2e1e9 100644 --- a/edit.c +++ b/edit.c @@ -9,6 +9,7 @@ #include #include +#include #include "abook_curses.h" #include "ui.h" #include "abook.h" @@ -37,7 +38,7 @@ editor_tab(const int tab) { int i; const int spacing = 12; - const char *tab_names[] = { + static char *tab_names[] = { "CONTACT", "ADDRESS", " PHONE ", @@ -146,7 +147,7 @@ print_editor_header(int item) 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); @@ -398,6 +399,7 @@ edit_loop(int item) 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;