summaryrefslogtreecommitdiff
path: root/dri2/dri2.go
diff options
context:
space:
mode:
authorAndrew Gallant <[email protected]>2013-08-11 20:54:15 -0400
committerAndrew Gallant <[email protected]>2013-08-11 20:54:15 -0400
commiteb7c38953b074e33f86861a3da4c05623cd44fc6 (patch)
tree0393a0a57afb536c401afb5e3587384c282ddd00 /dri2/dri2.go
parent8bc7a097c3aeddc1832d47cd74a9a365ab1f86ad (diff)
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.
Diffstat (limited to 'dri2/dri2.go')
-rw-r--r--dri2/dri2.go8
1 files changed, 4 insertions, 4 deletions
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 (