Open 3246251196 opened 4 weeks ago
Have you tried using snprintf as an alternative? Like you said, in linux this is working properly so I think this is strange
i think
/* Put a \0 at the end */
if (__putc(__clib4, '\0', (FILE * ) &string_iob, IOBF_BUFFER_MODE_NONE) == EOF) {
result = EOF;
}
can be removed from vsprintf since vfprintf is adding it already. Can you try it?
Test program:
Build and run.
Then, open outFile with a good editor or use hex-mode. Notice the following:
0x015 should not be \0.
This does not happen with Linux, newlib or clib2.
I can see that in vsprintf.c there is an explicit addition of \0.