From: Steve Bennett Date: Wed, 25 Jul 2018 06:52:10 +0000 (+1000) Subject: Fix some static analyser problems X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=d7bcf93d4de7581e043283ab461eca2310dd8fdc;p=linenoise.git Fix some static analyser problems Signed-off-by: Steve Bennett --- 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);