From 22009de5f84974e77147fd5264781fb1c09a7764 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Mon, 19 Mar 2018 20:22:54 +0000 Subject: [PATCH] Fix running the tests with -fsanitize=address. --- src/case.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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;