]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
lib: add comment in utf8_to_utf32_stream()
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Thu, 18 Jan 2024 17:54:50 +0000 (18:54 +0100)
committerTom Rini <trini@konsulko.com>
Wed, 24 Jan 2024 21:17:14 +0000 (16:17 -0500)
The logic of utf8_to_utf32_stream() is not easy to understand.
Add a comment.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
lib/charset.c

index 89057ef7ce22a21f33de9df1bfde46971cf551f8..2b43175b1d982af5f8d5ffcf9042dc3464ab66a7 100644 (file)
@@ -570,6 +570,10 @@ int utf8_to_utf32_stream(u8 c, char *buffer)
                }
                if (pos == end)
                        return 0;
+               /*
+                * Appending the byte lead to an invalid UTF-8 byte sequence.
+                * Consider it as the start of a new code sequence.
+                */
                *buffer = 0;
        }
 }