summaryrefslogtreecommitdiff
path: root/xf86vidmode/xf86vidmode.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 /xf86vidmode/xf86vidmode.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 'xf86vidmode/xf86vidmode.go')
-rw-r--r--xf86vidmode/xf86vidmode.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/xf86vidmode/xf86vidmode.go b/xf86vidmode/xf86vidmode.go
index 55ca67b..5a3f63d 100644
--- a/xf86vidmode/xf86vidmode.go
+++ b/xf86vidmode/xf86vidmode.go
@@ -418,9 +418,9 @@ func ModeInfoListBytes(buf []byte, list []ModeInfo) 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)
}
// BadModeUnsuitable is the error number for a BadModeUnsuitable.