PR comments

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
Esteban Papp
2021-08-06 10:00:58 -07:00
parent ae9d15c977
commit 8adf8fd7a1
2 changed files with 6 additions and 4 deletions
@@ -338,9 +338,9 @@ namespace AZStd
if (srcLen > 0)
{
char* endStr = Internal::WCharTPlatformConverter<>::to_string(dest, destSize, str, str + srcLen);
if (endStr < (dest + destSize) && *(endStr - 1) != '\0')
if (endStr < (dest + destSize))
{
*endStr = '\0'; // copy null terminator
*endStr = '\0'; // null terminator
}
}
}
@@ -495,9 +495,9 @@ namespace AZStd
if (srcLen > 0)
{
wchar_t* endWStr = Internal::WCharTPlatformConverter<>::to_wstring(dest, destSize, str, str + srcLen);
if (endWStr < (dest + destSize) && *(endWStr - 1) != '\0')
if (endWStr < (dest + destSize))
{
*endWStr = '\0'; // copy null terminator
*endWStr = '\0'; // null terminator
}
}
}
@@ -31,6 +31,7 @@ namespace AZ
SharedMemory_Common::CreateResult SharedMemory_Windows::Create(const char* name, unsigned int size, bool openIfCreated)
{
azstrncpy(m_name, AZ_ARRAY_SIZE(m_name), name, strlen(name));
AZStd::fixed_wstring<256> fullName;
ComposeName(fullName, name, L"Mutex");
@@ -67,6 +68,7 @@ namespace AZ
bool SharedMemory_Windows::Open(const char* name)
{
azstrncpy(m_name, AZ_ARRAY_SIZE(m_name), name, strlen(name));
AZStd::fixed_wstring<256> fullName;
ComposeName(fullName, name, L"Mutex");