mirror of
https://github.com/taglib/taglib.git
synced 2025-05-27 21:20:26 -04:00
Use wmemcpy() rather than memcpy() and sizeof(wchar_t).
This commit is contained in:
parent
db90f4b358
commit
0c0f123a08
@ -750,7 +750,7 @@ void String::copyFromUTF8(const char *s, size_t length)
|
||||
{
|
||||
d->data.resize(length);
|
||||
|
||||
if(length > 0) {
|
||||
if(length > 0) {
|
||||
const size_t len = UTF8toUTF16(s, length, &d->data[0], d->data.size());
|
||||
d->data.resize(len);
|
||||
}
|
||||
@ -782,7 +782,7 @@ void String::copyFromUTF16(const wchar_t *s, size_t length, Type t)
|
||||
d->data[i] = Utils::byteSwap(static_cast<ushort>(s[i]));
|
||||
}
|
||||
else {
|
||||
::memcpy(&d->data[0], s, length * sizeof(wchar_t));
|
||||
::wmemcpy(&d->data[0], s, length);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user