[FFmpeg-devel] [PATCH] bprint: add av_bprint_bytes().
nicolas.george at normalesup.org
Thu Jun 14 09:26:27 CEST 2012
Le septidi 27 prairial, an CCXX, Michael Niedermayer a écrit :
> btw, a bit off topic but can someone look at
> the bprintf test fails on mingw
The short answer to that is that their snprintf implementation is bogus
int n1 = snprintf(buf, sizeof(buf), "Hello world.\n");
int n2 = snprintf(NULL, 0, "Hello world.\n");
printf("n1=%d n2=%d errno=%d\n", n1, n2, errno);
n1=-1 n2=-1 errno=0
The standard mandates: "The snprintf function returns the number of
characters that would have been written had n been sufficiently large, not
counting the terminating null character, or a negative value if an
encoding error occurred."
And the errno codes listed by single Unix make it clear that "encoding
error" does not including buffer too small.
I'll try to think about it. If someone has an idea...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 198 bytes
Desc: Digital signature
More information about the ffmpeg-devel