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

Unified Diff: base/sys_info_linux.cc

Issue 471893003: Parse shmmax as a uint64 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/sys_info_linux.cc
diff --git a/base/sys_info_linux.cc b/base/sys_info_linux.cc
index eb89e5eb6d4cd4f75c19cb5da87300af7cd0904a..2e679ed39f3a52b7edc2b69d8ec5059575f9ed32 100644
--- a/base/sys_info_linux.cc
+++ b/base/sys_info_linux.cc
@@ -36,12 +36,11 @@ size_t MaxSharedMemorySize() {
contents.erase(contents.length() - 1);
}
- int64 limit;
- if (!base::StringToInt64(contents, &limit)) {
+ uint64 limit;
+ if (!base::StringToUint64(contents, &limit)) {
limit = 0;
}
- if (limit < 0 ||
- static_cast<uint64>(limit) > std::numeric_limits<size_t>::max()) {
+ if (limit > std::numeric_limits<size_t>::max()) {
limit = 0;
}
DCHECK(limit > 0);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698