XtSetValues (seq_image, arg, 1);
if (gstring.used > 0)
- {
- char *buf = alloca (gstring.used * 5);
-
- sprintf (buf, "%04X", gstring.glyphs[0].glyph_id);
- for (i = 1; i < gstring.used; i++)
- sprintf (buf + 4 + (i - 1) * 5, " %04X", gstring.glyphs[i].glyph_id);
- XtSetArg (arg[0], XtNlabel, buf);
- XtSetValues (code_list, arg, 1);
- }
+ {
+ int size = render_width / FONT_WIDTH;
+ char *buf = alloca (size + 1);
+
+ sprintf (buf, "%04X", gstring.glyphs[0].glyph_id);
+ for (i = 1, x = 4; i < gstring.used; i++, x += 5)
+ sprintf (buf + x, " %04X", gstring.glyphs[i].glyph_id);
+ while (x < size)
+ buf[x] = ' ';
+ buf[x] = '\0';
+ XtSetArg (arg[0], XtNlabel, buf);
+ XtSetValues (code_list, arg, 1);
+ }
free (gstring.glyphs);
}