Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(572)

Unified Diff: base/clipboard_linux.cc

Issue 172032: First cut for a FreeBSD port - much still not working (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: base/clipboard_linux.cc
===================================================================
--- base/clipboard_linux.cc (revision 25593)
+++ base/clipboard_linux.cc (working copy)
@@ -119,7 +119,10 @@
int i = 0;
for (Clipboard::TargetMap::iterator iter = clipboard_data_->begin();
iter != clipboard_data_->end(); ++iter, ++i) {
- targets[i].target = strndup(iter->first.data(), iter->first.size());
+ targets[i].target = static_cast<gchar*>(malloc(iter->first.size() + 1));
+ memcpy(targets[i].target, iter->first.data(), iter->first.size());
+ targets[i].target[iter->first.size()] = '\0';
+
targets[i].flags = 0;
targets[i].info = i;
}
« base/base.gyp ('K') | « base/clipboard.h ('k') | base/crypto/signature_verifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698