summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-22 19:25:23 +0000
committertc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-22 19:25:23 +0000
commitd8d90fcb555a2228ee8f64ddf4f844e75848fd45 (patch)
treee2d6bee6611ae6fde3d16a2e269a8fb1d53bf5c0
parent3a10f9d5a51b8ea356853eb65d536ca6ede41dd3 (diff)
downloadchromium_src-d8d90fcb555a2228ee8f64ddf4f844e75848fd45.zip
chromium_src-d8d90fcb555a2228ee8f64ddf4f844e75848fd45.tar.gz
chromium_src-d8d90fcb555a2228ee8f64ddf4f844e75848fd45.tar.bz2
Work around a UMR reported by purify by using a different ICU
method. The internets tell me that the UMR in getTerminatedBuffer() is harmless [1], but this seems better anyway. BUG=1339780 [1] http://osdir.com/ml/lib.icu.c++.support/2005-03/msg00022.html git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1232 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--base/time_format.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/base/time_format.cc b/base/time_format.cc
index 8d2d39e..c664e70 100644
--- a/base/time_format.cc
+++ b/base/time_format.cc
@@ -42,7 +42,11 @@ std::wstring TimeFormat(const DateFormat* formatter,
UnicodeString date_string;
formatter->format(static_cast<UDate>(time.ToDoubleT() * 1000), date_string);
- return UTF16ToWide(date_string.getTerminatedBuffer());
+ std::wstring output;
+ bool success = UTF16ToWide(date_string.getBuffer(), date_string.length(),
+ &output);
+ DCHECK(success);
+ return output;
}
}