From 0b4f7bf4c47c3be30a74b2a18c513af810df26cb Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 24 Dec 2020 06:41:46 -0800 Subject: linenoise: fix: int used instead of wchar_t. * linenoise.c (scan_match_rev, scan_match_fwd): The value of s[i] must be captured in a wchar_t, not int. --- linenoise/linenoise.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/linenoise/linenoise.c b/linenoise/linenoise.c index 4a624ad9..50830bef 100644 --- a/linenoise/linenoise.c +++ b/linenoise/linenoise.c @@ -1303,7 +1303,7 @@ static void move_cursor(lino_t *l, int npos) static int scan_match_rev(const wchar_t *s, int i, wchar_t mch) { while (i > 0) { - int ch = s[--i]; + wchar_t ch = s[--i]; if (ch == mch) return i; @@ -1348,7 +1348,7 @@ static int scan_rev(const wchar_t *s, int i) static int scan_match_fwd(const wchar_t *s, int i, wchar_t mch) { while (s[++i]) { - int ch = s[i]; + wchar_t ch = s[i]; if (ch == mch) return i; -- cgit v1.2.3