Fix snprintfW Return Value

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


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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: snprintf_fix.diff
Type: text/x-patch
Size: 2250 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20040709/ed52f76e/snprintf_fix.bin


More information about the wine-patches mailing list