"Alasdair Sinclair" <[EMAIL PROTECTED]> wrote:

GetComputerNameA shouldn't count the trailing NULL when returning the buffer.



--- a/dlls/kernel32/computername.c
+++ b/dlls/kernel32/computername.c
@@ -390,8 +390,7 @@ BOOL WINAPI GetComputerNameA(LPSTR name, LPDWORD size)
else {
            WideCharToMultiByte ( CP_ACP, 0, nameW, -1, name, len, NULL, 0 );
-            name[len] = 0;
-            *size = len;
+            *size = len - 1;
            ret = TRUE;

This change requires a test case.

--
Dmitry.


Reply via email to