diff --git a/randr/rrproviderproperty.c b/randr/rrproviderproperty.c index 23a105c02..45e9a63e6 100644 --- a/randr/rrproviderproperty.c +++ b/randr/rrproviderproperty.c @@ -685,26 +685,24 @@ ProcRRGetProviderProperty(ClientPtr client) swapl(&reply.bytesAfter); swapl(&reply.nItems); } + WriteToClient(client, sizeof(xGenericReply), &reply); if (len) { memcpy(extra, (char *) prop_value->data + ind, len); switch (reply.format) { case 32: - if (client->swapped) - SwapLongs((CARD32*) extra, len/sizeof(CARD32)); + client->pSwapReplyFunc = (ReplySwapPtr) CopySwap32Write; break; case 16: - if (client->swapped) - SwapShorts((short*) extra, len/sizeof(CARD16)); + client->pSwapReplyFunc = (ReplySwapPtr) CopySwap16Write; break; default: + client->pSwapReplyFunc = (ReplySwapPtr) WriteToClient; break; } + WriteSwappedDataToClient(client, len, extra); + free(extra); } - WriteToClient(client, sizeof(xGenericReply), &reply); - WriteToClient(client, len, extra); - free(extra); - if (stuff->delete && (reply.bytesAfter == 0)) { /* delete the Property */ *prev = prop->next; RRDestroyProviderProperty(prop);