On Friday 19 December 2025 14:58:23 Martin Storsjö wrote:
> On Fri, 19 Dec 2025, Pali Rohár wrote:
>
> > Ok. Thank you. What about following text? To make it clear if the nul
> > char itself is ignored or printed.
> >
> > Because this (narrow printf):
> > printf("%d%hZ%d", 1, compose_ANSI_STRING("A\0B"), 2);
> > returns <success> and prints: "1A\0B2"
> >
> > * 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.
> > * If encountering a nul char, it stops processing the format string and
> > returns -1.
> > * - crtdll, msvcrt10 and msvcrt before Vista accept nul char in ANSI_STRING
> > for wprintf,
> > * but the first nul char and everything after it in ANSI_STRING content
> > is discarded.
> > * - ANSI_STRING for printf, and UNICODE_STRING for both printf and wprintf
> > works fine
> > * in all versions, every nul byte in the string is processed and printed.
>
> "every nul byte and all following chars in the ANSI_STRING/UNICODE_STRING"
> maybe? Because now it sounds like it only includes the nul bytes, but
> doesn't say about the rest.
>
> Other than that, this sounds good and clear now!
>
> // Martin
Ok, sounds good. I will include this description into new version.
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public