On Wednesday 25 June 2025 00:29:13 Pali Rohár wrote:
> +          case 'Z':
> +            /*
> +             * The logic for `%Z` length modifier is quite complicated.
> +             *
> +             * for printf:
> +             * `%Z`  - UNICODE_STRING for UCRT; ANSI_STRING for 
> crtdll,msvcrt10,msvcrt,msvcr80-msvcr120
> +             * `%hZ` - ANSI_STRING
> +             * `%lZ` - UNICODE_STRING for UCRT; ANSI_STRING for 
> crtdll,msvcrt10,msvcrt,msvcr80-msvcr120
> +             * `%wZ` - UNICODE_STRING
> +             *
> +             * for wprintf:
> +             * `%Z`  - ANSI_STRING
> +             * `%hZ` - ANSI_STRING
> +             * `%lZ` - UNICODE_STRING for UCRT; ANSI_STRING for 
> crtdll,msvcrt10,msvcrt,msvcr80-msvcr120
> +             * `%wZ` - UNICODE_STRING
> +             *
> +             * There are some other changes between versions regarding nul 
> chars.
> +             * - msvcrt since Vista, msvcr80+ and UCRT do not accept nul 
> chars in ANSI_STRING for wprintf. They stop at nul char and returns -1.
> +             * - crtdll, msvcrt10 and msvcrt before Vista accept nul char in 
> ANSI_STRING for wprintf, but ANSI_STRING content after nul char is discarded.
> +             * - ANSI_STRING for printf, and UNICODE_STRING for both printf 
> and wprintf works fine in all versions.
> +             *
> +             * This mingw-w64 implementation uses UCRT behavior of length 
> modifiers.
> +             * And for compatibility with older msvcrt versions, it accepts 
> also
> +             * nul charts in ANSI_STRING for wprintf and discard content 
> after
> +             * nul char (like msvcrt).
> +             */

There is a typo: charts => chars


_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to