aboutsummaryrefslogtreecommitdiff
path: root/libX11/src/LiProps.c
diff options
context:
space:
mode:
Diffstat (limited to 'libX11/src/LiProps.c')
-rw-r--r--libX11/src/LiProps.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libX11/src/LiProps.c b/libX11/src/LiProps.c
index 72560aba7..d9c746563 100644
--- a/libX11/src/LiProps.c
+++ b/libX11/src/LiProps.c
@@ -34,7 +34,7 @@ Atom *XListProperties(
Window window,
int *n_props) /* RETURN */
{
- long nbytes;
+ unsigned long nbytes;
xListPropertiesReply rep;
Atom *properties;
register xResourceReq *req;
@@ -50,14 +50,14 @@ Atom *XListProperties(
if (rep.nProperties) {
nbytes = rep.nProperties * sizeof(Atom);
- properties = (Atom *) Xmalloc ((unsigned) nbytes);
- nbytes = rep.nProperties << 2;
+ properties = Xmalloc (nbytes);
if (! properties) {
- _XEatData(dpy, (unsigned long) nbytes);
+ _XEatDataWords(dpy, rep.length);
UnlockDisplay(dpy);
SyncHandle();
return (Atom *) NULL;
}
+ nbytes = rep.nProperties << 2;
_XRead32 (dpy, (long *) properties, nbytes);
}
else properties = (Atom *) NULL;