mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-14 02:27:40 -04:00
Fix a rather crippling plString bug on Linux.
This commit is contained in:
@ -74,8 +74,8 @@ void plString::IConvertFromUtf8(const char *utf8, size_t size, bool steal)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((long)size < 0)
|
if ((int32_t)size < 0)
|
||||||
size = strnlen(utf8, -(long)size);
|
size = strnlen(utf8, -(int32_t)size);
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
// Check to make sure the string is actually valid UTF-8
|
// Check to make sure the string is actually valid UTF-8
|
||||||
@ -113,8 +113,8 @@ void plString::IConvertFromUtf16(const uint16_t *utf16, size_t size)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((long)size < 0)
|
if ((int32_t)size < 0)
|
||||||
size = u16slen(utf16, -(long)size);
|
size = u16slen(utf16, -(int32_t)size);
|
||||||
|
|
||||||
// Calculate the UTF-8 size
|
// Calculate the UTF-8 size
|
||||||
size_t convlen = 0;
|
size_t convlen = 0;
|
||||||
@ -189,8 +189,8 @@ void plString::IConvertFromWchar(const wchar_t *wstr, size_t size)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((long)size < 0)
|
if ((int32_t)size < 0)
|
||||||
size = wcsnlen(wstr, -(long)size);
|
size = wcsnlen(wstr, -(int32_t)size);
|
||||||
|
|
||||||
// Calculate the UTF-8 size
|
// Calculate the UTF-8 size
|
||||||
size_t convlen = 0;
|
size_t convlen = 0;
|
||||||
@ -251,8 +251,8 @@ void plString::IConvertFromIso8859_1(const char *astr, size_t size)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((long)size < 0)
|
if ((int32_t)size < 0)
|
||||||
size = strnlen(astr, -(long)size);
|
size = strnlen(astr, -(int32_t)size);
|
||||||
|
|
||||||
// Calculate the UTF-8 size
|
// Calculate the UTF-8 size
|
||||||
size_t convlen = 0;
|
size_t convlen = 0;
|
||||||
|
Reference in New Issue
Block a user