[vlc-devel] [PATCH 1/1] Fix mingw failing to handle %zu

Geoffroy Couprie geo.couprie at gmail.com
Fri Nov 14 08:00:53 CET 2008


On Fri, Nov 14, 2008 at 7:21 AM, Jean-Baptiste Kempf <jb at videolan.org> wrote:
> On Thu, Nov 13, 2008 at 09:34:43PM +0000, davidf+nntp at woaf.net wrote :
>> The version of mingw currently [1] in use uses a non mscrt vsnprintf()
>
> What I understood is that this version of mingw uses a msvcrt that
> doesn't understand %z and %j.
>
> But maybe I was mistaken.
>
> VLC uses msvcrt 6.0 btw.
>

I didn't see anything about msvcrt's vsnprintf recognizing %z in msdn,
so I don't think it's mingw's fault here. Removing only the %zu is
apparently not an option, because %lu breaks something on x64. From
what was said on IRC, the saner way was rewriting the *printf
functions in VLC.

But for now, the crash only appears when the argument passed to %zu is
3 and there's a %s after %zu. It causes vsnprintf to interpret 3 as an
ASCII code, and it crashes (see your ASCII tables :p). The quick way
to have a non-crashing-at-startup master would be to rewrite this part
of modules.c to use int, and not size_t, as there are not that much
plugins in VLC (by the way, why size_t here?).

Regards,

Geal



More information about the vlc-devel mailing list