From: Frediano Ziglio Date: Wed, 25 Jun 2025 13:42:39 +0000 (+0100) Subject: include/grub/charset.h: Update documentation X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8ebf155af3e424941c1c352c9b2d8362e878969b;p=thirdparty%2Fgrub.git 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 --- 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