[PATCH 17/19] Set padding bytes to 0 in WriteToClient

Keith Packard keithp at keithp.com
Mon Jul 2 10:58:47 PDT 2012

Alan Coopersmith <alan.coopersmith at oracle.com> writes:

> Clear them out when needed instead of leaving whatever values were
> present in previously sent messages.

Given that nearly all of the calls to WriteToClient have already aligned
their data, I'd suggest that this should probably just use memset under
an if

        if (padBytes) {
                memset(oco->buf+oco->count), '\0', padBytes);
                oco->count += padBytes;

(also, we should get rid of the padlength array and just use
'-count & 3' instead :-)

keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20120702/0a8e3c5f/attachment.pgp>

More information about the xorg-devel mailing list