X-Git-Url: https://git.deb.at/w?a=blobdiff_plain;f=ui.c;h=7c71eb977a38af73aaf926f92fec68255b198aa7;hb=4909ba20244f55ee7326a40d751cf6737c2bc2b6;hp=20ec8feed48ecade9f964364e8815fefeb4a7064;hpb=9d57f5517367679f4f7be5af1aec91ac300db4e3;p=pkg%2Fabook.git diff --git a/ui.c b/ui.c index 20ec8fe..7c71eb9 100644 --- a/ui.c +++ b/ui.c @@ -38,7 +38,8 @@ * external variables */ -extern int items, curitem; +extern int curitem; +extern int items; extern char *datafile; extern bool alternative_datafile; @@ -281,7 +282,7 @@ statusline_askchoice(const char *msg, const char *choices, short dflt) char *s; int ch; - assert((dflt < 0) || (dflt > strlen(choices))); + assert((dflt >= 0) && (dflt <= strlen(choices))); if(dflt) { s = strdup_printf("%s [%c]", msg, choices[dflt - 1]); @@ -491,9 +492,9 @@ get_commands() case 'o': ui_open_datafile(); break; - case 's': sort_by_field(NAME); break; + case 's': sort_by_field("name");break; case 'S': sort_surname(); break; - case 'F': sort_by_field(-1); break; + case 'F': sort_by_field(NULL); break; case '/': ui_find(0); break; case '\\': ui_find(1); break; @@ -584,7 +585,6 @@ ui_find(int next) } } - void ui_print_number_of_items() {