|
|
@ -17,15 +17,14 @@ namespace Crash
|
|
|
|
namespace
|
|
|
|
namespace
|
|
|
|
{
|
|
|
|
{
|
|
|
|
template <class T, std::size_t N>
|
|
|
|
template <class T, std::size_t N>
|
|
|
|
void writePathToShm(T(&buffer)[N], const std::filesystem::path& path)
|
|
|
|
void writePathToShm(T (&buffer)[N], const std::filesystem::path& path)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
memset(buffer, 0, sizeof(buffer));
|
|
|
|
memset(buffer, 0, sizeof(buffer));
|
|
|
|
const auto str = path.u8string();
|
|
|
|
const auto str = path.u8string();
|
|
|
|
size_t length = str.length();
|
|
|
|
size_t length = str.length();
|
|
|
|
if (length >= sizeof(buffer))
|
|
|
|
if (length >= sizeof(buffer))
|
|
|
|
length = sizeof(buffer) - 1;
|
|
|
|
length = sizeof(buffer) - 1;
|
|
|
|
strncpy_s(buffer, sizeof(buffer),
|
|
|
|
strncpy_s(buffer, sizeof(buffer), Misc::StringUtils::u8StringToString(str).c_str(), length);
|
|
|
|
Misc::StringUtils::u8StringToString(str).c_str(), length);
|
|
|
|
|
|
|
|
buffer[length] = '\0';
|
|
|
|
buffer[length] = '\0';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|