diff options
author | Sergio Giro <sgiro@google.com> | 2016-07-21 14:44:07 +0100 |
---|---|---|
committer | Sergio Giro <sgiro@google.com> | 2016-07-29 17:54:30 +0100 |
commit | 03b95c7df5fb577fa6e4c133dcdbc85c880d86b4 (patch) | |
tree | cbd69ca4c90b3e09d069f24c246f5a659f77964d /tools/aapt2/util/Util.cpp | |
parent | 0ce1875e0c3ad5541e1e2151e41197c7e363fe40 (diff) |
Unicode: specify destination length in utf8_to_utf16 methods
Change-Id: I5223caa7d42f4582a982609a898a02043265c6d3
Diffstat (limited to 'tools/aapt2/util/Util.cpp')
-rw-r--r-- | tools/aapt2/util/Util.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/aapt2/util/Util.cpp b/tools/aapt2/util/Util.cpp index 3c0e9bdeab0d..e743247be8a9 100644 --- a/tools/aapt2/util/Util.cpp +++ b/tools/aapt2/util/Util.cpp @@ -434,7 +434,11 @@ std::u16string utf8ToUtf16(const StringPiece& utf8) { std::u16string utf16; utf16.resize(utf16Length); - utf8_to_utf16(reinterpret_cast<const uint8_t*>(utf8.data()), utf8.length(), &*utf16.begin()); + utf8_to_utf16( + reinterpret_cast<const uint8_t*>(utf8.data()), + utf8.length(), + &*utf16.begin(), + (size_t) utf16Length + 1); return utf16; } |