]> git.deb.at Git - pkg/abook.git/blobdiff - edit.c
remover a debug message
[pkg/abook.git] / edit.c
diff --git a/edit.c b/edit.c
index 12028f8722d1191e4cc8bb91f6672e608afa0300..8a2e1e98f247f28fbd1068fc7f99cbbedb8cfaa8 100644 (file)
--- a/edit.c
+++ b/edit.c
@@ -9,6 +9,7 @@
 
 #include <string.h>
 #include <stdlib.h>
+#include <assert.h>
 #include "abook_curses.h"
 #include "ui.h"
 #include "abook.h"
@@ -33,11 +34,11 @@ extern int items;
 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 ",
@@ -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);
@@ -371,6 +372,8 @@ edit_undo(int item, int mode)
                                my_free(backup);
                        }
                        break;
+               default:
+                       assert(0);
        }
 }
 
@@ -396,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;