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

Side by Side Diff: app/clipboard/clipboard_linux.cc

Issue 195067: Turn NULL used as int to 0.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | app/gfx/native_widget_types.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "app/clipboard/clipboard.h" 5 #include "app/clipboard/clipboard.h"
6 6
7 #include <gtk/gtk.h> 7 #include <gtk/gtk.h>
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 } 197 }
198 198
199 void Clipboard::WriteBookmark(const char* title_data, size_t title_len, 199 void Clipboard::WriteBookmark(const char* title_data, size_t title_len,
200 const char* url_data, size_t url_len) { 200 const char* url_data, size_t url_len) {
201 // Write as plain text. 201 // Write as plain text.
202 WriteText(url_data, url_len); 202 WriteText(url_data, url_len);
203 203
204 // Write as a URI. 204 // Write as a URI.
205 char* data = new char[url_len + 1]; 205 char* data = new char[url_len + 1];
206 memcpy(data, url_data, url_len); 206 memcpy(data, url_data, url_len);
207 data[url_len] = NULL; 207 data[url_len] = '\0';
208 InsertMapping(kMimeURI, data, url_len + 1); 208 InsertMapping(kMimeURI, data, url_len + 1);
209 } 209 }
210 210
211 void Clipboard::WriteFiles(const char* file_data, size_t file_len) { 211 void Clipboard::WriteFiles(const char* file_data, size_t file_len) {
212 NOTIMPLEMENTED(); 212 NOTIMPLEMENTED();
213 } 213 }
214 214
215 void Clipboard::WriteData(const char* format_name, size_t format_len, 215 void Clipboard::WriteData(const char* format_name, size_t format_len,
216 const char* data_data, size_t data_len) { 216 const char* data_data, size_t data_len) {
217 char* data = new char[data_len]; 217 char* data = new char[data_len];
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 case BUFFER_SELECTION: 401 case BUFFER_SELECTION:
402 result = primary_selection_; 402 result = primary_selection_;
403 break; 403 break;
404 default: 404 default:
405 NOTREACHED(); 405 NOTREACHED();
406 result = NULL; 406 result = NULL;
407 break; 407 break;
408 } 408 }
409 return result; 409 return result;
410 } 410 }
OLDNEW
« no previous file with comments | « no previous file | app/gfx/native_widget_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698