Skip to content

Commit 2ed57ba

Browse files
authored
Fix off-by-one error (#1)
1 parent 3792c10 commit 2ed57ba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/wcwidth/Wcwidth.hx

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ class Wcwidth {
125125
if (ucs < 32 || (ucs >= 0x7f && ucs < 0xa0)) return -1;
126126

127127
// binary search in table of non-spacing characters
128-
if (_bisearch(ucs, combining, combining.length)) return 0;
128+
if (_bisearch(ucs, combining, combining.length - 1)) return 0;
129129

130130
// if we arrive here, ucs is not a combining or C0/C1 control character
131131
return 1 +

0 commit comments

Comments
 (0)