From eb7c38953b074e33f86861a3da4c05623cd44fc6 Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Sun, 11 Aug 2013 20:54:15 -0400 Subject: Padding on a list is on the length of the list. There was a bug where padding was being computed on each element of the list. Close #5. --- dri2/dri2.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'dri2') diff --git a/dri2/dri2.go b/dri2/dri2.go index 1561832..df13661 100644 --- a/dri2/dri2.go +++ b/dri2/dri2.go @@ -86,9 +86,9 @@ func AttachFormatListBytes(buf []byte, list []AttachFormat) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } const ( @@ -291,9 +291,9 @@ func DRI2BufferListBytes(buf []byte, list []DRI2Buffer) int { for _, item := range list { structBytes = item.Bytes() copy(buf[b:], structBytes) - b += xgb.Pad(len(structBytes)) + b += len(structBytes) } - return b + return xgb.Pad(b) } const ( -- cgit v1.2.3