]> Kevux Git Server - fll/commitdiff
Bugfix: The < 0xc2 test is supposed to be against the first byte rather than the...
authorKevin Day <thekevinday@gmail.com>
Wed, 22 Jun 2022 23:06:06 +0000 (18:06 -0500)
committerKevin Day <thekevinday@gmail.com>
Wed, 22 Jun 2022 23:06:06 +0000 (18:06 -0500)
level_0/f_utf/c/private-utf_valid.c
level_0/f_utf/tests/unit/c/test-utf-character_is_valid.c
level_0/f_utf/tests/unit/c/test-utf-is_valid.c

index de38afa..daa52a9 100644 (file)
@@ -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;
       }
 
index 207c890..c1267c7 100644 (file)
@@ -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;
index ec3a572..9d2c531 100644 (file)
@@ -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;