mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-24 04:55:52 +00:00
Fix UTF32 string creation
This commit is contained in:
@@ -132,9 +132,9 @@ public:
|
|||||||
return getEmpty();
|
return getEmpty();
|
||||||
|
|
||||||
const size_t numBytes = (size_t) (end.getAddress() - start.getAddress());
|
const size_t numBytes = (size_t) (end.getAddress() - start.getAddress());
|
||||||
const CharPointerType dest (createUninitialisedBytes (numBytes + 1));
|
const CharPointerType dest (createUninitialisedBytes (numBytes + sizeof (CharType)));
|
||||||
memcpy (dest.getAddress(), start, numBytes);
|
memcpy (dest.getAddress(), start, numBytes);
|
||||||
dest.getAddress()[numBytes] = 0;
|
dest.getAddress()[numBytes / sizeof (CharType)] = 0;
|
||||||
return dest;
|
return dest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user