]> git.deb.at Git - pkg/abook.git/blobdiff - ui.c
- minor editor_tab() cleanup
[pkg/abook.git] / ui.c
diff --git a/ui.c b/ui.c
index 874812d48430bb64a9a9fb99dee73710dc75791e..901322b50712c6f4295d71e11336d1713845c096 100644 (file)
--- 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);