aboutsummaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/string_conversion.cc4
1 files changed, 2 insertions, 2 deletions
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<u_int16_t> *out) {
}
void UTF32ToUTF16Char(wchar_t in, u_int16_t out[2]) {
- const UTF32 *source_ptr = reinterpret_cast<const UTF32 *>(in);
- const UTF32 *source_end_ptr = source_ptr + sizeof(wchar_t);
+ const UTF32 *source_ptr = reinterpret_cast<const UTF32 *>(&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;