summaryrefslogtreecommitdiff
path: root/xgbgen/go_struct.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 /xgbgen/go_struct.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 'xgbgen/go_struct.go')
-rw-r--r--xgbgen/go_struct.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/xgbgen/go_struct.go b/xgbgen/go_struct.go
index 984a336..0f18084 100644
--- a/xgbgen/go_struct.go
+++ b/xgbgen/go_struct.go
@@ -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("")
}