summaryrefslogtreecommitdiffstats
path: root/base/time_format.cc
diff options
context:
space:
mode:
Diffstat (limited to 'base/time_format.cc')
-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;
}
}