[Bug 272758] c16rtomb and c32rtomb wrong return value (at least on aarch64)

From: <bugzilla-noreply_at_freebsd.org>
Date: Tue, 12 Sep 2023 17:24:20 UTC

--- Comment #3 from Dimitry Andric <dim@FreeBSD.org> ---
(In reply to John F. Carr from comment #1)
Yes, setting the mbstate_t to zero is what should be done. Quoting C11 7.29.6:
> The initial conversion state corresponds, for a conversion in either direction, to the beginning of a new multibyte character in the initial shift state. A zero-valued mbstate_t object is (at least) one way to describe an initial conversion state. A zero- valued mbstate_t object can be used to initiate conversion involving any multibyte character sequence, in any LC_CTYPE category setting. If an mbstate_t object has been altered by any of the functions described in this subclause, and is then used with a different multibyte character sequence, or in the other conversion direction, or with a different LC_CTYPE category setting than on earlier function calls, the behavior is undefined.

You are receiving this mail because:
You are the assignee for the bug.