It appears that the "Str" type (which is built into the core X protocol)

doesn't specify any padding. So it has to be treated as a special case.

Close #12.
This commit is contained in:
Andrew Gallant
2013-12-28 10:02:18 -05:00
committed by Přemysl Janouch
parent ad9c35a02f
commit 33509dbeb0
10 changed files with 52 additions and 49 deletions

View File

@@ -1543,7 +1543,7 @@ func getMonitorReply(buf []byte) *GetMonitorReply {
byteString := make([]byte, v.VendorLength)
copy(byteString[:v.VendorLength], buf[b:])
v.Vendor = string(byteString)
b += xgb.Pad(int(v.VendorLength))
b += int(v.VendorLength)
}
v.AlignmentPad = make([]byte, (((int(v.VendorLength) + 3) & -4) - int(v.VendorLength)))
@@ -1554,7 +1554,7 @@ func getMonitorReply(buf []byte) *GetMonitorReply {
byteString := make([]byte, v.ModelLength)
copy(byteString[:v.ModelLength], buf[b:])
v.Model = string(byteString)
b += xgb.Pad(int(v.ModelLength))
b += int(v.ModelLength)
}
return v