]> 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 de38afaf2bb0f076f68ce2b716ababfed0832fe8..daa52a947220debec59cf44146c1fcff06530d68 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 207c890b903d6001557899c8f82c91036e029c3e..c1267c75956d73644822ad8a852dc785a8640748 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 ec3a572809693534b7401db3ea5fd17fe9818bbd..9d2c53164a73294d3ae187247fe69e0b5ec6be1d 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;