From 38b293e74db6631873d5dfd74cf731eb7b76737d 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. --- nexgb/xselinux/xselinux.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'nexgb/xselinux') diff --git a/nexgb/xselinux/xselinux.go b/nexgb/xselinux/xselinux.go index 757a285..f24f5d7 100644 --- a/nexgb/xselinux/xselinux.go +++ b/nexgb/xselinux/xselinux.go @@ -115,9 +115,9 @@ func ListItemListBytes(buf []byte, list []ListItem) 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) } // ListItemListSize computes the size (bytes) of a list of ListItem values. -- cgit v1.2.3-70-g09d2