From 8ebf155af3e424941c1c352c9b2d8362e878969b Mon Sep 17 00:00:00 2001 From: Frediano Ziglio Date: Wed, 25 Jun 2025 14:42:39 +0100 Subject: [PATCH] include/grub/charset.h: Update documentation (grub_size_t) -1 is never returned, the function always return a not negative values. This is important for overflows considerations. Signed-off-by: Frediano Ziglio Reviewed-by: Daniel Kiper --- include/grub/charset.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/grub/charset.h b/include/grub/charset.h index 31a3b52dd..df79aae53 100644 --- a/include/grub/charset.h +++ b/include/grub/charset.h @@ -117,7 +117,8 @@ grub_utf8_process (grub_uint8_t c, grub_uint32_t *code, int *count) /* Convert a (possibly null-terminated) UTF-8 string of at most SRCSIZE bytes (if SRCSIZE is -1, it is ignored) in length to a UTF-16 string. Return the number of characters converted. DEST must be able to hold - at least DESTSIZE characters. If an invalid sequence is found, return -1. + at least DESTSIZE characters. If an invalid sequence is found, it is + replaced by a question mark ('?'). If SRCEND is not NULL, then *SRCEND is set to the next byte after the last byte used in SRC. */ static inline grub_size_t -- 2.47.3