[PATCH 2/2] vsnprintfW: Return (int)written when given a NULL buffer and zero len

Hugh McMaster hugh.mcmaster at outlook.com
Tue Jan 6 06:55:15 CST 2015

msvcrt.dll's _vsnprintf and _vsnwprintf return the number of chars that would be written when given a NULL buffer and zero len, but Wine currently returns -1. This patch alters Wine's vsnprintfW (found in libs/wine/string.c) to follow msvcrt's behaviour in this special case.

This patch is essential for dynamic memory management used in upcoming patches.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-stringc-special-case.patch
Type: application/octet-stream
Size: 829 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20150106/379d7851/attachment.obj>

More information about the wine-patches mailing list