From 05b72b8da17d6077b085608c128ec9e698473bb6 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sat, 2 Mar 2013 16:56:16 -0800 Subject: Convert more _XEatData callers to _XEatDataWords Signed-off-by: Alan Coopersmith Reviewed-by: Matthieu Herrb Signed-off-by: Julien Cristau Backported-to-NX-by: Ulrich Sibiller --- nx-X11/lib/X11/QuColors.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'nx-X11/lib/X11/QuColors.c') diff --git a/nx-X11/lib/X11/QuColors.c b/nx-X11/lib/X11/QuColors.c index e51375fa0..a8bc8837b 100644 --- a/nx-X11/lib/X11/QuColors.c +++ b/nx-X11/lib/X11/QuColors.c @@ -37,9 +37,7 @@ XQueryColors( int ncolors) { register int i; - xrgb *color; xQueryColorsReply rep; - long nbytes; register xQueryColorsReq *req; LockDisplay(dpy); @@ -53,8 +51,9 @@ XQueryColors( /* XXX this isn't very efficient */ if (_XReply(dpy, (xReply *) &rep, 0, xFalse) != 0) { - if ((color = (xrgb *) - Xmalloc((unsigned) (nbytes = (long) ncolors * SIZEOF(xrgb))))) { + unsigned long nbytes = (long) ncolors * SIZEOF(xrgb); + xrgb *color = Xmalloc(nbytes); + if (color != NULL) { _XRead(dpy, (char *) color, nbytes); @@ -68,7 +67,8 @@ XQueryColors( } Xfree((char *)color); } - else _XEatData(dpy, (unsigned long) nbytes); + else + _XEatDataWords(dpy, rep.length); } UnlockDisplay(dpy); SyncHandle(); -- cgit v1.2.3