From fe8866e169dcf2ab1657d2e0f2041ae6f3146d2c Mon Sep 17 00:00:00 2001 From: evchnoch Date: Wed, 26 Sep 2018 21:29:51 +0300 Subject: [PATCH] Update Rune.ColumnWidth.cs Causing System.IndexOutOfRangeException in bisearch(uint rune, uint [,] table, int max) at if (rune < table [0, 0] || rune > table [max, 1]) --- NStack/unicode/Rune.ColumnWidth.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NStack/unicode/Rune.ColumnWidth.cs b/NStack/unicode/Rune.ColumnWidth.cs index 2d9f715..af1a653 100644 --- a/NStack/unicode/Rune.ColumnWidth.cs +++ b/NStack/unicode/Rune.ColumnWidth.cs @@ -94,7 +94,7 @@ public static int ColumnWidth (Rune rune) if (irune >= 0x7f && irune <= 0xa0) return 0; /* binary search in table of non-spacing characters */ - if (bisearch (irune, combining, combining.GetLength (0)) != 0) + if (bisearch (irune, combining, combining.GetLength (0) - 1) != 0) return 0; /* if we arrive here, ucs is not a combining or C0/C1 control character */ return 1 +