Fix snprintfW Return Value

Rob Shearman rob at codeweavers.com
Sat Jul 10 12:17:54 CDT 2004


On Fri, 2004-07-09 at 19:55, Alexandre Julliard wrote:
> Rob Shearman <rob at codeweavers.com> writes:
> 
> > 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.
> 
> Actually, something does depend on it: it is used to implement
> _vsnwprintf in ntdll, so you can't change it.

How about this updated patch then?

Rob

Changelog:
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_fix3.diff
Type: text/x-patch
Size: 2800 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20040710/928e5927/snprintf_fix3.bin


More information about the wine-patches mailing list