Commit d0f86f64 authored by Uwe Bonnes's avatar Uwe Bonnes Committed by Alexandre Julliard

get_full_path_helper: Handle the case \\.\\ as intended; fix length

arguments for memmove.
parent 16c3f341
......@@ -499,7 +499,7 @@ static ULONG get_full_path_helper(LPCWSTR name, LPWSTR buffer, ULONG size)
/* either collapse \foo\.. into \ or \.. into \ */
if (prev < buffer + mark) prev = p - 1;
reqsize -= (p + 2 - prev) * sizeof(WCHAR);
memmove(prev, p + 2, buffer + reqsize - prev + sizeof(WCHAR));
memmove(prev, p + 2, reqsize + sizeof(WCHAR) - (prev - buffer) * sizeof(WCHAR));
p = prev;
}
break;
......@@ -511,7 +511,7 @@ static ULONG get_full_path_helper(LPCWSTR name, LPWSTR buffer, ULONG size)
break;
case '\\':
reqsize -= 2 * sizeof(WCHAR);
memmove(ptr, ptr + 2, buffer + reqsize - ptr + sizeof(WCHAR));
memmove(p, p + 2, reqsize + sizeof(WCHAR) - (p - buffer) * sizeof(WCHAR));
break;
}
}
......
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