vsnprintf: glibc and win32 not compatible

Bill Medland billmedland at mercuryspeed.com
Mon Mar 8 12:54:46 CST 2004


On March 8, 2004 10:15 am, Alexandre Julliard wrote:
> Mike Hearn <mh at codeweavers.com> writes:
> > On Sun, 07 Mar 2004 19:32:39 -0700, Jesse Allen wrote:
> >> 1)  Create our own vsnprintf version from scratch   (fairly difficult)
> >> or
> >> 2)  Create a wrapper for glibc's vsnprintf that translates win32ish
> >> format statements into a glibc friendly one.  (not too bad and smaller
> >> patch)  We could later move in a better or complete version to improve
> >> performance.
> >
> > 3) Copy/paste the glibc version into Wine with appropriate munging and
> > start fixing bugs in it.
> >
> > No clue which is best. Alexandre?
>
> Probably 3), but I don't think you want to start with the glibc code,
> it's fairly ugly code, with many dependencies on glibc internals and
> gcc-specific things. Hopefully we can find a more portable
> implementation somewhere else.

Just to complicate things there is also the complication that (at least on my 
system) the Windows version has an off-by-1 bug.
(msvcrt 6.1.9844 - snprintf (buffer, 4, "%d", 4321) writes 4321, returns 4 and 
does not add the \0)

-- 
Bill Medland
mailto:billmedland at mercuryspeed.com
http://webhome.idirect.com/~kbmed




More information about the wine-devel mailing list