Fix snprintfW Return Value

Rob Shearman rob at
Fri Jul 9 10:26:40 CDT 2004


At present, if the size of the buffer passed to snprintfW is too small
then the function returns -1, as opposed to the required size of the
buffer (as per C snprintf). This greatly limits its usefulness and can
give incorrect results for those using the function that don't
explicitly check for -1 being returned. A grep of the source tree shows
that nothing depends on this behaviour.


Fix snprintfW to return the required buffer size in the case of the
actual buffer being too small

-------------- next part --------------
A non-text attachment was scrubbed...
Name: snprintf_fix.diff
Type: text/x-patch
Size: 2250 bytes
Desc: not available
Url :

More information about the wine-patches mailing list