WriteToClient: preserve constness of buf while extracting length value
Fixes gcc warning: io.c: In function 'WriteToClient': io.c:826:6: warning: cast discards qualifiers from pointer target type Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
2c9800f915
commit
af4113bfeb
2
os/io.c
2
os/io.c
|
@ -823,7 +823,7 @@ WriteToClient (ClientPtr who, int count, const void *__buf)
|
|||
CARD32 replylen;
|
||||
unsigned long bytesleft;
|
||||
|
||||
replylen = ((xGenericReply *)buf)->length;
|
||||
replylen = ((const xGenericReply *)buf)->length;
|
||||
if (who->swapped)
|
||||
swapl(&replylen);
|
||||
bytesleft = (replylen * 4) + SIZEOF(xReply) - count - padBytes;
|
||||
|
|
Loading…
Reference in New Issue
Block a user