From c4d599912cb4189bf20b07c541130201035736a1 Mon Sep 17 00:00:00 2001 From: waylonis Date: Wed, 20 Dec 2006 17:22:41 +0000 Subject: Fix UTF32ToUTF16Char() conversion. Fixes issue #99. Reviewed by bryner. git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@97 4c0a9323-5329-0410-9bdc-e9ce6186880e --- src/common/string_conversion.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/common') diff --git a/src/common/string_conversion.cc b/src/common/string_conversion.cc index e2345783..20682045 100644 --- a/src/common/string_conversion.cc +++ b/src/common/string_conversion.cc @@ -98,8 +98,8 @@ void UTF32ToUTF16(const wchar_t *in, vector *out) { } void UTF32ToUTF16Char(wchar_t in, u_int16_t out[2]) { - const UTF32 *source_ptr = reinterpret_cast(in); - const UTF32 *source_end_ptr = source_ptr + sizeof(wchar_t); + const UTF32 *source_ptr = reinterpret_cast(&in); + const UTF32 *source_end_ptr = source_ptr + 1; u_int16_t *target_ptr = out; u_int16_t *target_end_ptr = target_ptr + 2 * sizeof(u_int16_t); out[0] = out[1] = 0; -- cgit v1.2.1