diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2020-12-24 06:41:46 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2020-12-24 06:41:46 -0800 |
commit | 1b7b434d331972353865dded8069cfa18bc37604 (patch) | |
tree | 6eca08340714847ca2e012b0db64513c97423705 | |
parent | aa668fda182380def49e5ccb80eaf9c772ca3921 (diff) | |
download | txr-1b7b434d331972353865dded8069cfa18bc37604.tar.gz txr-1b7b434d331972353865dded8069cfa18bc37604.tar.bz2 txr-1b7b434d331972353865dded8069cfa18bc37604.zip |
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.
-rw-r--r-- | linenoise/linenoise.c | 4 |
1 files 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; |