diff options
author | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-28 14:10:11 +0000 |
---|---|---|
committer | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-28 14:10:11 +0000 |
commit | 224e75e4f3778203e4ab199bbd8bbf287e4af4f5 (patch) | |
tree | 63cb98ba7be7a5ba4e80429a8f883ae989b008c6 /chrome/common/logging_chrome.cc | |
parent | 19fc89ac35d993699ea84031957715dfdcb347ba (diff) | |
download | chromium_src-224e75e4f3778203e4ab199bbd8bbf287e4af4f5.zip chromium_src-224e75e4f3778203e4ab199bbd8bbf287e4af4f5.tar.gz chromium_src-224e75e4f3778203e4ab199bbd8bbf287e4af4f5.tar.bz2 |
Pass the correct array size to readlink, and pass the length of the result to the string constructor
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/4181004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64240 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/logging_chrome.cc')
-rw-r--r-- | chrome/common/logging_chrome.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/chrome/common/logging_chrome.cc b/chrome/common/logging_chrome.cc index 9bbb878..a1963ce 100644 --- a/chrome/common/logging_chrome.cc +++ b/chrome/common/logging_chrome.cc @@ -171,9 +171,9 @@ FilePath SetUpSymlinkIfNeeded(const FilePath& symlink_path, bool new_log) { } } else { char buf[1024]; - size_t count = readlink(target_path.value().c_str(), buf, sizeof(buf)); + size_t count = readlink(target_path.value().c_str(), buf, arraysize(buf)); if (count > 0) { - target_path = FilePath(FilePath::StringType(buf)); + target_path = FilePath(FilePath::StringType(buf, count)); } else { PLOG(ERROR) << "Unable to read symlink " << symlink_path.value(); } |