mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 04:02:41 +01:00
Support/FileSystem: Fix copy_file implementation to use toNullTerminatedStringRef
instead of toStringRef. The file system APIs need c strings. llvm-svn: 120601
This commit is contained in:
parent
03bbd0f21d
commit
8908ec62e4
@ -71,8 +71,8 @@ error_code copy_file(const Twine &from, const Twine &to, copy_option copt) {
|
||||
// Get arguments.
|
||||
SmallString<128> from_storage;
|
||||
SmallString<128> to_storage;
|
||||
StringRef f = from.toStringRef(from_storage);
|
||||
StringRef t = to.toStringRef(to_storage);
|
||||
StringRef f = from.toNullTerminatedStringRef(from_storage);
|
||||
StringRef t = to.toNullTerminatedStringRef(to_storage);
|
||||
|
||||
const size_t buf_sz = 32768;
|
||||
char buffer[buf_sz];
|
||||
|
@ -104,8 +104,8 @@ error_code copy_file(const Twine &from, const Twine &to, copy_option copt) {
|
||||
// Get arguments.
|
||||
SmallString<128> from_storage;
|
||||
SmallString<128> to_storage;
|
||||
StringRef f = from.toStringRef(from_storage);
|
||||
StringRef t = to.toStringRef(to_storage);
|
||||
StringRef f = from.toNullTerminatedStringRef(from_storage);
|
||||
StringRef t = to.toNullTerminatedStringRef(to_storage);
|
||||
|
||||
// Convert to utf-16.
|
||||
SmallVector<wchar_t, 128> wide_from;
|
||||
|
Loading…
Reference in New Issue
Block a user