* valprint.c (generic_emit_char, generic_printstr): Pass size of
authorTom Tromey <tromey@redhat.com>
Thu, 18 Oct 2012 15:26:01 +0000 (15:26 +0000)
committerTom Tromey <tromey@redhat.com>
Thu, 18 Oct 2012 15:26:01 +0000 (15:26 +0000)
gdb_wchar_t to convert_between_encodings.

gdb/ChangeLog
gdb/valprint.c

index 8ad818697966c41fbda92c9cff8062a244deb185..2ac0ecdd3f1e7df2df66b1f9fb123fbb2cd653a9 100644 (file)
@@ -1,3 +1,8 @@
+2012-10-18  Tom Tromey  <tromey@redhat.com>
+
+       * valprint.c (generic_emit_char, generic_printstr): Pass size of
+       gdb_wchar_t to convert_between_encodings.
+
 2012-10-17  Yao Qi  <yao@codesourcery.com>
 
        * breakpoint.c (invalidate_bp_value_on_memory_change): Add one
index 6e651f6ce844510a13bfe7f0024d82d5e8bf7538..583329d3baf4d2d180dac7d9c803750ba5f3fb30 100644 (file)
@@ -2037,7 +2037,7 @@ generic_emit_char (int c, struct type *type, struct ui_file *stream,
   convert_between_encodings (INTERMEDIATE_ENCODING, host_charset (),
                             obstack_base (&wchar_buf),
                             obstack_object_size (&wchar_buf),
-                            1, &output, translit_char);
+                            sizeof (gdb_wchar_t), &output, translit_char);
   obstack_1grow (&output, '\0');
 
   fputs_filtered (obstack_base (&output), stream);
@@ -2278,7 +2278,7 @@ generic_printstr (struct ui_file *stream, struct type *type,
   convert_between_encodings (INTERMEDIATE_ENCODING, host_charset (),
                             obstack_base (&wchar_buf),
                             obstack_object_size (&wchar_buf),
-                            1, &output, translit_char);
+                            sizeof (gdb_wchar_t), &output, translit_char);
   obstack_1grow (&output, '\0');
 
   fputs_filtered (obstack_base (&output), stream);