Commit bf823755 authored by Sergei Turchanov's avatar Sergei Turchanov Committed by Alexandre Julliard

- _SHStrDupAA forgot about terminating '\0'.

- SHStrDupA adds extra terminator which is not needed as the length returned by MultiByteToWideChar(,,-1,,) already includes it.
parent 5e71f2d5
......@@ -1716,7 +1716,7 @@ static HRESULT WINAPI _SHStrDupAA(LPCSTR src, LPSTR * dest)
int len = 0;
if (src) {
len = lstrlenA(src);
len = lstrlenA(src) + 1;
*dest = CoTaskMemAlloc(len);
} else {
*dest = NULL;
......@@ -1753,7 +1753,7 @@ HRESULT WINAPI SHStrDupA(LPCSTR src, LPWSTR * dest)
int len = 0;
if (src) {
len = (MultiByteToWideChar(0,0,src,-1,0,0) + 1)* sizeof(WCHAR);
len = MultiByteToWideChar(0,0,src,-1,0,0) * sizeof(WCHAR);
*dest = CoTaskMemAlloc(len);
} else {
*dest = NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment