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:
@@ -93,9 +93,9 @@ func (s *Struct) WriteList(c *Context) {
|
||||
c.Putln("for _, item := range list {")
|
||||
c.Putln("structBytes = item.Bytes()")
|
||||
c.Putln("copy(buf[b:], structBytes)")
|
||||
c.Putln("b += xgb.Pad(len(structBytes))")
|
||||
c.Putln("b += len(structBytes)")
|
||||
c.Putln("}")
|
||||
c.Putln("return b")
|
||||
c.Putln("return xgb.Pad(b)")
|
||||
c.Putln("}")
|
||||
c.Putln("")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user