Skip to content

Commit

Permalink
Fix off-by-one error (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
JerwuQu authored Jan 4, 2022
1 parent 3792c10 commit 2ed57ba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/wcwidth/Wcwidth.hx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class Wcwidth {
if (ucs < 32 || (ucs >= 0x7f && ucs < 0xa0)) return -1;

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

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

0 comments on commit 2ed57ba

Please sign in to comment.