Fix snprintfW Return Value

Robert Shearman R.J.Shearman at warwick.ac.uk
Fri Jul 9 11:00:59 CDT 2004


On Fri, 2004-07-09 at 16:26, Rob Shearman wrote:
> Hi,
> 
> 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.
> 
> Rob
> 
> Changelog:
> Fix snprintfW to return the required buffer size in the case of the
> actual buffer being too small

And here is a slightly better patch without the infinite loops.

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_fix2.diff
Type: text/x-patch
Size: 2300 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20040709/a982f8df/snprintf_fix2.bin


More information about the wine-patches mailing list