From: Kevin Day Date: Wed, 22 Jun 2022 23:06:06 +0000 (-0500) Subject: Bugfix: The < 0xc2 test is supposed to be against the first byte rather than the... X-Git-Tag: 0.5.10~26 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=9ee159550f99e2f62c502c04c5e7c1bceec6d8a8;p=fll Bugfix: The < 0xc2 test is supposed to be against the first byte rather than the second. --- diff --git a/level_0/f_utf/c/private-utf_valid.c b/level_0/f_utf/c/private-utf_valid.c index de38afa..daa52a9 100644 --- a/level_0/f_utf/c/private-utf_valid.c +++ b/level_0/f_utf/c/private-utf_valid.c @@ -77,7 +77,7 @@ extern "C" { if ((macro_f_utf_char_t_to_char_1(sequence) & 0b11100000) == 0b11000000) { // Only first byte ranges 0xc2 or greater are valid. - if (macro_f_utf_char_t_to_char_2(sequence) < 0xc2) { + if (macro_f_utf_char_t_to_char_1(sequence) < 0xc2) { return F_false; } diff --git a/level_0/f_utf/tests/unit/c/test-utf-character_is_valid.c b/level_0/f_utf/tests/unit/c/test-utf-character_is_valid.c index 207c890..c1267c7 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-character_is_valid.c +++ b/level_0/f_utf/tests/unit/c/test-utf-character_is_valid.c @@ -124,7 +124,7 @@ void test__f_utf_character_is_valid__works(void **state) { if ((first & 0b11100000) == 0b11000000) { // Only first byte ranges 0xc2 or greater are valid. - if (second < 0xc2) { + if (first < 0xc2) { assert_int_equal(status, F_false); continue; diff --git a/level_0/f_utf/tests/unit/c/test-utf-is_valid.c b/level_0/f_utf/tests/unit/c/test-utf-is_valid.c index ec3a572..9d2c531 100644 --- a/level_0/f_utf/tests/unit/c/test-utf-is_valid.c +++ b/level_0/f_utf/tests/unit/c/test-utf-is_valid.c @@ -101,7 +101,7 @@ void test__f_utf_is_valid__works(void **state) { if ((first & 0b11100000) == 0b11000000) { // Only first byte ranges 0xc2 or greater are valid. - if (second < 0xc2) { + if (first < 0xc2) { assert_int_equal(status, F_false); continue;