summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/metrics_log_manager.cc2
-rw-r--r--chrome/common/time_format.cc4
2 files changed, 3 insertions, 3 deletions
diff --git a/chrome/common/metrics_log_manager.cc b/chrome/common/metrics_log_manager.cc
index 37a9e4b..960672a 100644
--- a/chrome/common/metrics_log_manager.cc
+++ b/chrome/common/metrics_log_manager.cc
@@ -105,7 +105,7 @@ void MetricsLogManager::LoadPersistedUnsentLogs() {
void MetricsLogManager::CompressStagedLog() {
int text_size = staged_log_->GetEncodedLogSize();
std::string staged_log_text;
- // Leave room for the NULL terminator.
+ DCHECK_GT(text_size, 0);
staged_log_->GetEncodedLog(WriteInto(&staged_log_text, text_size + 1),
text_size);
diff --git a/chrome/common/time_format.cc b/chrome/common/time_format.cc
index 75407a9..c4cf9ca 100644
--- a/chrome/common/time_format.cc
+++ b/chrome/common/time_format.cc
@@ -296,9 +296,9 @@ static string16 FormatTimeImpl(const TimeDelta& delta, FormatType format_type) {
// With the fallback added, this should never fail.
DCHECK(U_SUCCESS(error));
int capacity = time_string.length() + 1;
+ DCHECK_GT(capacity, 1);
string16 result;
- time_string.extract(static_cast<UChar*>(
- WriteInto(&result, capacity)),
+ time_string.extract(static_cast<UChar*>(WriteInto(&result, capacity)),
capacity, error);
DCHECK(U_SUCCESS(error));
return result;