X-Git-Url: https://git.deb.at/w?a=blobdiff_plain;f=ui.c;h=901322b50712c6f4295d71e11336d1713845c096;hb=ee93ebe91c2e21396a80287da56547cbe3c3347d;hp=874812d48430bb64a9a9fb99dee73710dc75791e;hpb=a07d2a804360c52a8630ae22d7a123de13bc0d91;p=pkg%2Fabook.git diff --git a/ui.c b/ui.c index 874812d..901322b 100644 --- a/ui.c +++ b/ui.c @@ -243,8 +243,11 @@ ui_readline(char *prompt, char *s, size_t limit, bool use_completion) ret = abook_readline(bottom, y, x, s, use_completion); - if(ret) + if(ret) { strtrim(ret); + if(strlen(ret) > limit && limit > 0) + ret[limit] = '\0'; + } return ret; } @@ -593,7 +596,7 @@ ui_open_datafile() load_database(filename); if(items == 0) { - statusline_msg(_("Sorry, that specified file appears not to be a valid abook addressbook")); + statusline_msg(_("Sorry, the specified file appears not to be a valid abook addressbook")); load_database(datafile); } else { free(datafile);