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

Unified Diff: base/base_paths_mac.mm

Issue 8418034: Make string_util::WriteInto() DCHECK() that the supplied |length_with_null| > 1, meaning that the... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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
« no previous file with comments | « no previous file | base/rand_util.h » ('j') | base/string_util_unittest.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/base_paths_mac.mm
===================================================================
--- base/base_paths_mac.mm (revision 108344)
+++ base/base_paths_mac.mm (working copy)
@@ -26,14 +26,11 @@
// how the app was launched.
uint32_t executable_length = 0;
_NSGetExecutablePath(NULL, &executable_length);
- DCHECK_GE(executable_length, 1u);
+ DCHECK_GT(executable_length, 1u);
cbentzel 2011/11/15 11:37:10 Is this guaranteed? Should "return false" be used
Peter Kasting 2011/11/15 18:50:32 The old code already DCHECKed that the length wasn
Mark Mentovai 2011/11/28 22:41:21 Peter Kasting wrote:
std::string executable_path;
- char* executable_path_c = WriteInto(&executable_path, executable_length);
- int rv = _NSGetExecutablePath(executable_path_c, &executable_length);
+ int rv = _NSGetExecutablePath(WriteInto(&executable_path, executable_length),
+ &executable_length);
DCHECK_EQ(rv, 0);
- DCHECK(!executable_path.empty());
- if ((rv != 0) || (executable_path.empty()))
- return false;
*path = FilePath(executable_path);
return true;
Mark Mentovai 2011/11/28 22:41:21 As written now, is there even a good reason for th
Peter Kasting 2011/11/29 01:48:15 I agree with you. Changed to void.
}
« no previous file with comments | « no previous file | base/rand_util.h » ('j') | base/string_util_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698