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

@@ -659,7 +659,7 @@ func getClientDriverNameReply(buf []byte) *GetClientDriverNameReply {
byteString := make([]byte, v.ClientDriverNameLen)
copy(byteString[:v.ClientDriverNameLen], buf[b:])
v.ClientDriverName = string(byteString)
b += xgb.Pad(int(v.ClientDriverNameLen))
b += int(v.ClientDriverNameLen)
}
return v
@@ -1017,7 +1017,7 @@ func openConnectionReply(buf []byte) *OpenConnectionReply {
byteString := make([]byte, v.BusIdLen)
copy(byteString[:v.BusIdLen], buf[b:])
v.BusId = string(byteString)
b += xgb.Pad(int(v.BusIdLen))
b += int(v.BusIdLen)
}
return v