From d7bcf93d4de7581e043283ab461eca2310dd8fdc Mon Sep 17 00:00:00 2001 From: Steve Bennett Date: Wed, 25 Jul 2018 16:52:10 +1000 Subject: [PATCH] Fix some static analyser problems Signed-off-by: Steve Bennett --- linenoise.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/linenoise.c b/linenoise.c index 1271445..fceecf4 100644 --- a/linenoise.c +++ b/linenoise.c @@ -1349,7 +1349,7 @@ static void capture_chars(struct current *current, int pos, int nchars) int offset = utf8_index(sb_str(current->buf), pos); int nbytes = utf8_index(sb_str(current->buf) + offset, nchars); - if (nbytes) { + if (nbytes > 0) { if (current->capture) { sb_clear(current->capture); } @@ -1732,6 +1732,7 @@ history_navigation: int linenoiseColumns(void) { struct current current; + current.output = NULL; enableRawMode (¤t); getWindowSize (¤t); disableRawMode (¤t); -- 2.44.0