X-Git-Url: https://git.deb.at/?a=blobdiff_plain;f=ui.c;h=901322b50712c6f4295d71e11336d1713845c096;hb=89e2a4996a7a50c18905408887b8eea25b0fc303;hp=808ead07e15dcdc211fe35964d611222de018ab9;hpb=2c5d21ffb7ca5a922817b6eeef4381d386829fc9;p=pkg%2Fabook.git diff --git a/ui.c b/ui.c index 808ead0..901322b 100644 --- a/ui.c +++ b/ui.c @@ -243,10 +243,11 @@ ui_readline(char *prompt, char *s, size_t limit, bool use_completion) ret = abook_readline(bottom, y, x, s, use_completion); - /* XXX: check that string doesn't exceed limit */ - - if(ret) + if(ret) { strtrim(ret); + if(strlen(ret) > limit && limit > 0) + ret[limit] = '\0'; + } return ret; }