[PATCH] libs/wine/string.c: Always return (int)written

Hugh McMaster hugh.mcmaster at outlook.com
Wed Dec 17 06:02:09 CST 2014


On Wednesday, Dec 17 05:54:42 CST 2014, Jonathan Vollebregt wrote:

>No: http://msdn.microsoft.com/en-us/library/1kt27hek.aspx#returnValueToggle
>>  vsnprintf ,_vsnprintf, and _vsnwprintf return the number of characters written if the number of characters to write is less than or equal to count; if the number of characters to write is greater than count, these functions return -1 indicating that output has been truncated. The return value does not include the terminating null, if one is written.
>>
>> If buffer or format is NULL, or if count is less than or equal to zero, these functions invoke the invalid parameter handler, as described in Parameter Validation. If execution is allowed to continue, these functions return -1 and set errno to EINVAL.

I disagree. vsnprintfW is not a Windows function. We should be following the Linux form here, which returns the number of chars that would be written.
 		 	   		  


More information about the wine-devel mailing list