[PATCH 1/1] lib: add comment in utf8_to_utf32_stream()

Heinrich Schuchardt heinrich.schuchardt at canonical.com
Thu Jan 18 18:54:50 CET 2024


The logic of utf8_to_utf32_stream() is not easy to understand.
Add a comment.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt at canonical.com>
---
 lib/charset.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/charset.c b/lib/charset.c
index 89057ef7ce..2b43175b1d 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;
 	}
 }
-- 
2.43.0



More information about the U-Boot mailing list