mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-13 12:40:04 +00:00
I don't like reformatting things over and over.
This commit is contained in:
parent
1bdcb5d6d9
commit
677c17530e
@ -17,15 +17,14 @@ namespace Crash
|
||||
namespace
|
||||
{
|
||||
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));
|
||||
const auto str = path.u8string();
|
||||
size_t length = str.length();
|
||||
if (length >= sizeof(buffer))
|
||||
length = sizeof(buffer) - 1;
|
||||
strncpy_s(buffer, sizeof(buffer),
|
||||
Misc::StringUtils::u8StringToString(str).c_str(), length);
|
||||
strncpy_s(buffer, sizeof(buffer), Misc::StringUtils::u8StringToString(str).c_str(), length);
|
||||
buffer[length] = '\0';
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user