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

Unified Diff: components/safe_browsing_db/v4_protocol_manager_util.cc

Issue 2928793002: Use the substr API correctly in FullHashToHashPrefix. (Closed)
Patch Set: Created 3 years, 6 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 | components/safe_browsing_db/v4_protocol_manager_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/safe_browsing_db/v4_protocol_manager_util.cc
diff --git a/components/safe_browsing_db/v4_protocol_manager_util.cc b/components/safe_browsing_db/v4_protocol_manager_util.cc
index 44aeee983a4353e95c3463aefd0bda26863b6246..bd097a72b58a30e2b6f31d0408d0de0fc8a0e703 100644
--- a/components/safe_browsing_db/v4_protocol_manager_util.cc
+++ b/components/safe_browsing_db/v4_protocol_manager_util.cc
@@ -305,7 +305,7 @@ bool V4ProtocolManagerUtil::FullHashToHashPrefix(const FullHash& full_hash,
if (full_hash.size() < prefix_size) {
return false;
}
- *hash_prefix = full_hash.substr(prefix_size);
+ *hash_prefix = full_hash.substr(0, prefix_size);
return true;
}
« no previous file with comments | « no previous file | components/safe_browsing_db/v4_protocol_manager_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698