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.
This commit is contained in:
@@ -86,9 +86,9 @@ func ClientListBytes(buf []byte, list []Client) 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)
|
||||
}
|
||||
|
||||
type Type struct {
|
||||
@@ -140,9 +140,9 @@ func TypeListBytes(buf []byte, list []Type) 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)
|
||||
}
|
||||
|
||||
// Skipping definition for base type 'Bool'
|
||||
|
||||
Reference in New Issue
Block a user