summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
Diffstat (limited to 'chrome')
-rw-r--r--chrome/common/os_exchange_data.cc2
-rw-r--r--chrome/common/os_exchange_data_unittest.cc4
2 files changed, 3 insertions, 3 deletions
diff --git a/chrome/common/os_exchange_data.cc b/chrome/common/os_exchange_data.cc
index ea050de..36553c1 100644
--- a/chrome/common/os_exchange_data.cc
+++ b/chrome/common/os_exchange_data.cc
@@ -330,7 +330,7 @@ void OSExchangeData::SetFileContents(const std::wstring& filename,
ClipboardUtil::GetFileDescriptorFormat()->cfFormat, storage));
// Add CFSTR_FILECONTENTS
- storage = GetStorageForString(file_contents);
+ storage = GetStorageForBytes(file_contents.data(), file_contents.length());
contents_.push_back(new StoredDataInfo(
ClipboardUtil::GetFileContentFormatZero()->cfFormat, storage));
}
diff --git a/chrome/common/os_exchange_data_unittest.cc b/chrome/common/os_exchange_data_unittest.cc
index 594a91a..f54cb72 100644
--- a/chrome/common/os_exchange_data_unittest.cc
+++ b/chrome/common/os_exchange_data_unittest.cc
@@ -265,8 +265,8 @@ TEST(OSExchangeDataTest, TestURLExchangeFormats) {
STGMEDIUM medium;
EXPECT_EQ(S_OK, com_data->GetData(&format_etc, &medium));
- std::string output =
- ScopedHGlobal<char>(medium.hGlobal).get();
+ ScopedHGlobal<char> glob(medium.hGlobal);
+ std::string output(glob.get(), glob.Size());
std::string file_contents = "[InternetShortcut]\r\nURL=" + url_spec + "\r\n";
EXPECT_EQ(file_contents, output);
ReleaseStgMedium(&medium);