From: Heinrich Schuchardt Date: Thu, 18 Jan 2024 17:54:50 +0000 (+0100) Subject: lib: add comment in utf8_to_utf32_stream() X-Git-Tag: v2024.04-rc1~15^2~2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3150da34c2689b28154432c4b863e01ab92d3214;p=pandora-u-boot.git lib: add comment in utf8_to_utf32_stream() The logic of utf8_to_utf32_stream() is not easy to understand. Add a comment. Signed-off-by: Heinrich Schuchardt --- diff --git a/lib/charset.c b/lib/charset.c index 89057ef7ce2..2b43175b1d9 100644 --- a/lib/charset.c +++ b/lib/charset.c @@ -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; } }