]> git.deb.at Git - pkg/abook.git/commitdiff
Minor cleanups
authorJaakko Heinonen <jheinonen@users.sourceforge.net>
Mon, 2 Apr 2001 20:35:24 +0000 (20:35 +0000)
committerJaakko Heinonen <jheinonen@users.sourceforge.net>
Mon, 2 Apr 2001 20:35:24 +0000 (20:35 +0000)
database.c
edit.c
list.c

index 03e20ed38857b129e9d07613ab50746a92c254fa..8b8d2bedb58fd644994e3bb75fd67a9759be76ff 100644 (file)
@@ -152,10 +152,9 @@ write_database(FILE *out)
        for( i = 0; i < items; i++ ) {
                fprintf(out, "[%d]\n", i);
                for(j=0; j<ITEM_FIELDS; j++) {
-                       if( database[i][j] != NULL )
-                               if( *database[i][j] )
-                                       fprintf(out, "%s=%s\n",
-                                               abook_fields[j].key, database[i][j]);
+                       if( database[i][j] != NULL && *database[i][j] )
+                               fprintf(out, "%s=%s\n",
+                                       abook_fields[j].key, database[i][j]);
                }
                fputc('\n', out);
        }
@@ -450,8 +449,7 @@ find(int next)
 void
 print_number_of_items()
 {
-       char *str =
-               mkstr("     |%3d/%3d", selected_items(), items);
+       char *str = mkstr("     " "|%3d/%3d", selected_items(), items);
 
        mvaddstr(0, COLS-strlen(str), str);
 
diff --git a/edit.c b/edit.c
index 50363f3e4ea5898dba0435ef839d49c0254b9d96..28009fec627d57f843e6bfc67be5a4f39667b1f7 100644 (file)
--- a/edit.c
+++ b/edit.c
@@ -242,7 +242,9 @@ edit_emails(char c, int item)
        split_emailstr(item, emails);
 
        if(change_field("E-mail: ", &field)) {
+#ifdef DEBUG
                fprintf(stderr, "change_field = TRUE\n");
+#endif
                return; /* user cancelled ( C-g ) */
        }
        if(field) {
diff --git a/list.c b/list.c
index ce0f9efa6eb3f8304ff8897ae4b65b8ffe19dcb4..01bb156f67f30e13b5d70f32b2b5bb64c87df3e3 100644 (file)
--- a/list.c
+++ b/list.c
@@ -269,13 +269,13 @@ highlight_line(WINDOW *win, int line)
 int
 selected_items()
 {
-       int i, a=0;
+       int i, n = 0;
 
        for(i = 0; i < items; i++)
                if(selected[i])
-                       a++;
+                       n++;
 
-       return a;
+       return n;
 }
 
 void