From: Frediano Ziglio via Grub-devel <grub-devel@gnu.org>
To: grub-devel@gnu.org
Cc: Frediano Ziglio <frediano.ziglio@cloud.com>
Subject: [PATCH v3 2/6] include/grub/charset.h: Update documentation
Date: Wed, 25 Jun 2025 07:42:23 +0100 [thread overview]
Message-ID: <20250625064229.17960-2-frediano.ziglio@cloud.com> (raw)
In-Reply-To: <20250625064229.17960-1-frediano.ziglio@cloud.com>
(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>
---
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.49.0
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
next prev parent reply other threads:[~2025-06-25 6:43 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-25 6:42 [PATCH v3 1/6] loader/efi/linux: Remove useless assignment Frediano Ziglio via Grub-devel
2025-06-25 6:42 ` Frediano Ziglio via Grub-devel [this message]
2025-06-25 6:42 ` [PATCH v3 3/6] loader/efi/linux: Do not pass excessive size for source string Frediano Ziglio via Grub-devel
2025-06-25 12:27 ` Daniel Kiper
2025-06-25 13:03 ` Frediano Ziglio via Grub-devel
2025-06-25 6:42 ` [PATCH v3 4/6] loader/efi/linux: Use proper type for "len" variable Frediano Ziglio via Grub-devel
2025-06-25 6:42 ` [PATCH v3 5/6] loader/efi/linux: Use sizeof instead of constant Frediano Ziglio via Grub-devel
2025-06-25 6:42 ` [PATCH v3 6/6] loader/efi/linux: Correctly terminate LoadOptions field Frediano Ziglio via Grub-devel
2025-06-25 12:41 ` Daniel Kiper
2025-06-25 13:27 ` Frediano Ziglio via Grub-devel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250625064229.17960-2-frediano.ziglio@cloud.com \
--to=grub-devel@gnu.org \
--cc=frediano.ziglio@cloud.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.