From 3bc1cf3e11be566e3d342834abe8fde7f5983a80 Mon Sep 17 00:00:00 2001 From: Peter Jeremy Date: Mon, 27 Feb 2012 13:39:58 +1100 Subject: Bug 46664 - xscope prints only half the characters in 16-bit strings https://bugs.freedesktop.org/show_bug.cgi?id=46664 The length fields for PolyText16 and ImageText16 represent the number of 16-bit characters in the request but PrintString16() and PrintTString16() treat the lengths as the number of octets in the string - thus printing only half of the characters. Signed-off-by: Alan Coopersmith --- prtype.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/prtype.c b/prtype.c index 371d315..be80806 100644 --- a/prtype.c +++ b/prtype.c @@ -928,7 +928,7 @@ PrintString16( return(0); fprintf(stdout, "%s%20s: \"", Leader, name); - for (i = 0; i < number; i += 2) + for (i = 0; i < number*2; i += 2) { c = IChar2B(&buf[i]); fprintf(stdout, "%s", printrep(c)); @@ -978,7 +978,7 @@ PrintTString16( if (TranslateText) off = 0x20; fprintf(stdout, "%s%20s: \"", Leader, name); - for (i = 0; i < number; i += 2) + for (i = 0; i < number*2; i += 2) { c = IChar2B(&buf[i]); fprintf(stdout, "%s", printrep(c + off)); -- cgit v1.2.1