Fixed GetEnvironmentVariableX: Return sting length including '\0'

This commit is contained in:
akallabeth 2022-03-03 08:07:02 +01:00 committed by akallabeth
parent 952068145e
commit c99c4cecdd
1 changed files with 1 additions and 1 deletions

View File

@ -671,7 +671,7 @@ DWORD GetEnvironmentVariableX(const char* lpName, char* lpBuffer, DWORD nSize)
result = GetEnvironmentVariableW(lpNameW, lpBufferMaxW, nSizeW);
status = ConvertFromUnicode(CP_UTF8, 0, lpBufferMaxW, _wcsnlen(lpBufferMaxW, nSizeW),
status = ConvertFromUnicode(CP_UTF8, 0, lpBufferMaxW, _wcsnlen(lpBufferMaxW, nSizeW) + 1,
&lpTmpBuffer, sizeof(lpBufferMaxA), NULL, NULL);
if (status > 0)