diff options
author | Andrew Gallant <jamslam@gmail.com> | 2013-08-11 20:54:15 -0400 |
---|---|---|
committer | Přemysl Janouch <p@janouch.name> | 2018-09-08 16:49:18 +0200 |
commit | 38b293e74db6631873d5dfd74cf731eb7b76737d (patch) | |
tree | aca66c5633a1c2e823318efdd05ff5ff996f4021 /nexgb/dri2/dri2.go | |
parent | b06a8ca97625c1134449c3af65d9ac3fb251a613 (diff) | |
download | haven-38b293e74db6631873d5dfd74cf731eb7b76737d.tar.gz haven-38b293e74db6631873d5dfd74cf731eb7b76737d.tar.xz haven-38b293e74db6631873d5dfd74cf731eb7b76737d.zip |
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 'nexgb/dri2/dri2.go')
-rw-r--r-- | nexgb/dri2/dri2.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/nexgb/dri2/dri2.go b/nexgb/dri2/dri2.go index 1561832..df13661 100644 --- a/nexgb/dri2/dri2.go +++ b/nexgb/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 ( |