summaryrefslogtreecommitdiff
path: root/print_render.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2012-07-14 22:35:18 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2012-10-02 22:14:45 -0700
commite1e857744290f0a09d60435e8d5997efb0a436ba (patch)
treee33c8d9a38465d9bff4693f1d2c9bbe9c58b6f69 /print_render.c
parent4ba266b7b08cf5914b5ec6912763d319f57f00bc (diff)
downloadxscope-e1e857744290f0a09d60435e8d5997efb0a436ba.tar.gz
Handle big-requests when calculating request contents from length field
Adds a getreqlen inline function to handle the big requests check. As noted in the comment, it must be called *before* the printreqlen macro does its own check, since printreqlen "fixes" the buf pointer when it's done to align all the remaining fields with their correct positions after skipping over the extra big requests 32-bit length field after the normal 16-bit length field. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'print_render.c')
-rw-r--r--print_render.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/print_render.c b/print_render.c
index f8d14e3..769fde5 100644
--- a/print_render.c
+++ b/print_render.c
@@ -432,15 +432,15 @@ RenderAddGlyphsFromPicture(FD fd, const unsigned char *buf)
void
RenderFreeGlyphs(FD fd, const unsigned char *buf)
{
- unsigned short n;
+ uint32_t n;
RenderRequestHeader(fd, buf);
if (Verbose < 1)
return;
+ n = (getreqlen(fd, buf) - 2);
printreqlen(buf, fd, CONST2(2));
PrintField(buf, 4, 4, GLYPHSET, "glyphset");
- n = (IShort(&buf[2]) - 2);
(void) PrintList(&buf[8], (long) n, CARD32, "glyphs");
}