Fixed bugged resource locator (PR 1632)

This commit is contained in:
Gliniak 2020-07-27 10:41:23 +02:00
parent fe22352831
commit 856cce8fe3
1 changed files with 2 additions and 1 deletions

View File

@ -113,7 +113,7 @@ dword_result_t keXamBuildResourceLocator(uint64_t module,
uint32_t buffer_count) {
std::u16string path;
if (!module) {
path = fmt::format(u"file://media:/{0}.xzp#{0}", container, resource);
path = fmt::format(u"file://media:/{}.xzp#{}", container, resource);
XELOGD(
"XamBuildResourceLocator({0}) returning locator to local file {0}.xzp",
xe::to_utf8(container));
@ -123,6 +123,7 @@ dword_result_t keXamBuildResourceLocator(uint64_t module,
}
auto copy_count = std::min(size_t(buffer_count), path.size());
xe::copy_and_swap(buffer_ptr.as<char16_t*>(), path.c_str(), copy_count);
(buffer_ptr.as<char16_t*>())[copy_count] = 0;
return 0;
}