]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
include/grub/charset.h: Update documentation
authorFrediano Ziglio <frediano.ziglio@cloud.com>
Wed, 25 Jun 2025 13:42:39 +0000 (14:42 +0100)
committerDaniel Kiper <daniel.kiper@oracle.com>
Thu, 26 Jun 2025 16:05:08 +0000 (18:05 +0200)
(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 <frediano.ziglio@cloud.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
include/grub/charset.h

index 31a3b52dde96cbdbd98b86cee6aa4a8c041033d2..df79aae53f499cc77e7ffe4d28fb5b5c43ce3214 100644 (file)
@@ -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