From 89e2a4996a7a50c18905408887b8eea25b0fc303 Mon Sep 17 00:00:00 2001 From: Jaakko Heinonen Date: Sun, 25 Sep 2005 11:20:49 +0000 Subject: [PATCH] - implement limit functionality in ui_readline --- ui.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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; } -- 2.39.2