diff --git a/src/case.c b/src/case.c index 9ab0223a..0ea48143 100644 --- a/src/case.c +++ b/src/case.c @@ -2664,7 +2664,7 @@ static const struct case_conversion_entry case_conversion_data[] = codepoint_t ucd_toupper(codepoint_t c) { int begin = 0; - int end = sizeof(case_conversion_data)/sizeof(case_conversion_data[0]); + int end = (sizeof(case_conversion_data)/sizeof(case_conversion_data[0])) - 1; while (begin <= end) { int pos = (begin + end) / 2; @@ -2682,7 +2682,7 @@ codepoint_t ucd_toupper(codepoint_t c) codepoint_t ucd_tolower(codepoint_t c) { int begin = 0; - int end = sizeof(case_conversion_data)/sizeof(case_conversion_data[0]); + int end = (sizeof(case_conversion_data)/sizeof(case_conversion_data[0])) - 1; while (begin <= end) { int pos = (begin + end) / 2; @@ -2700,7 +2700,7 @@ codepoint_t ucd_tolower(codepoint_t c) codepoint_t ucd_totitle(codepoint_t c) { int begin = 0; - int end = sizeof(case_conversion_data)/sizeof(case_conversion_data[0]); + int end = (sizeof(case_conversion_data)/sizeof(case_conversion_data[0])) - 1; while (begin <= end) { int pos = (begin + end) / 2;