http://bugs.winehq.org/show_bug.cgi?id=16195
--- Comment #7 from Dmitry Timoshkov dmitry@codeweavers.com 2008-11-26 23:02:29 --- (In reply to comment #6)
int len; len = MultiByteToWideChar(CP_UNIXCP, 0, name, -1, lpBuffer, nSize); lpBuffer[len - 1] = 0; return len;
Looks good, please send to wine-patches. You even can eliminate introducing 'len' by reusing 'nSize'.