summaryrefslogtreecommitdiffstats
path: root/base/clipboard_util.cc
diff options
context:
space:
mode:
authortc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-16 17:17:08 +0000
committertc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-16 17:17:08 +0000
commit276189825fa64723d2425f444697d750eb173855 (patch)
tree7e4ca85b604c969f670cd2616e9ea0b3500da727 /base/clipboard_util.cc
parent151e7e7c5150adee1a6a680d0bee40c92776acd1 (diff)
downloadchromium_src-276189825fa64723d2425f444697d750eb173855.zip
chromium_src-276189825fa64723d2425f444697d750eb173855.tar.gz
chromium_src-276189825fa64723d2425f444697d750eb173855.tar.bz2
Revert "Fix a bug where we were truncating the last byte of images"
due to purify regression TBR=sky Review URL: http://codereview.chromium.org/7437 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3465 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/clipboard_util.cc')
-rw-r--r--base/clipboard_util.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/base/clipboard_util.cc b/base/clipboard_util.cc
index 9d35db4..5902b43 100644
--- a/base/clipboard_util.cc
+++ b/base/clipboard_util.cc
@@ -356,7 +356,8 @@ bool ClipboardUtil::GetFileContents(IDataObject* data_object,
if (SUCCEEDED(data_object->GetData(GetFileContentFormatZero(), &content))) {
if (TYMED_HGLOBAL == content.tymed) {
ScopedHGlobal<char> data(content.hGlobal);
- file_contents->assign(data.get(), data.Size());
+ // The size includes the trailing NULL byte. We don't want it.
+ file_contents->assign(data.get(), data.Size() - 1);
}
ReleaseStgMedium(&content);
}