aboutsummaryrefslogtreecommitdiff
path: root/nexgb/xgbgen
diff options
context:
space:
mode:
authorAndrew Gallant <jamslam@gmail.com>2013-08-11 20:54:15 -0400
committerPřemysl Janouch <p@janouch.name>2018-09-08 16:49:18 +0200
commit38b293e74db6631873d5dfd74cf731eb7b76737d (patch)
treeaca66c5633a1c2e823318efdd05ff5ff996f4021 /nexgb/xgbgen
parentb06a8ca97625c1134449c3af65d9ac3fb251a613 (diff)
downloadhaven-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/xgbgen')
-rw-r--r--nexgb/xgbgen/go_struct.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/nexgb/xgbgen/go_struct.go b/nexgb/xgbgen/go_struct.go
index 984a336..0f18084 100644
--- a/nexgb/xgbgen/go_struct.go
+++ b/nexgb/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("")
}