diff options
| author | Andrew Gallant <jamslam@gmail.com> | 2013-12-28 10:02:18 -0500 | 
|---|---|---|
| committer | Přemysl Janouch <p@janouch.name> | 2018-09-08 16:49:21 +0200 | 
| commit | 33509dbeb0acd7abbbb9e8c434d0c3f0ce8a3230 (patch) | |
| tree | ce7d66adcb2e7fd3802a884b0fae618dfa1533a6 /nexgb/xselinux | |
| parent | ad9c35a02f190ea5da59c9c4a3aeddcf7e8a5c1f (diff) | |
| download | haven-33509dbeb0acd7abbbb9e8c434d0c3f0ce8a3230.tar.gz haven-33509dbeb0acd7abbbb9e8c434d0c3f0ce8a3230.tar.xz haven-33509dbeb0acd7abbbb9e8c434d0c3f0ce8a3230.zip | |
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.
Diffstat (limited to 'nexgb/xselinux')
| -rw-r--r-- | nexgb/xselinux/xselinux.go | 30 | 
1 files changed, 15 insertions, 15 deletions
| diff --git a/nexgb/xselinux/xselinux.go b/nexgb/xselinux/xselinux.go index f24f5d7..454fdf2 100644 --- a/nexgb/xselinux/xselinux.go +++ b/nexgb/xselinux/xselinux.go @@ -62,14 +62,14 @@ func ListItemRead(buf []byte, v *ListItem) int {  		byteString := make([]byte, v.ObjectContextLen)  		copy(byteString[:v.ObjectContextLen], buf[b:])  		v.ObjectContext = string(byteString) -		b += xgb.Pad(int(v.ObjectContextLen)) +		b += int(v.ObjectContextLen)  	}  	{  		byteString := make([]byte, v.DataContextLen)  		copy(byteString[:v.DataContextLen], buf[b:])  		v.DataContext = string(byteString) -		b += xgb.Pad(int(v.DataContextLen)) +		b += int(v.DataContextLen)  	}  	return b @@ -224,7 +224,7 @@ func getClientContextReply(buf []byte) *GetClientContextReply {  		byteString := make([]byte, v.ContextLen)  		copy(byteString[:v.ContextLen], buf[b:])  		v.Context = string(byteString) -		b += xgb.Pad(int(v.ContextLen)) +		b += int(v.ContextLen)  	}  	return v @@ -323,7 +323,7 @@ func getDeviceContextReply(buf []byte) *GetDeviceContextReply {  		byteString := make([]byte, v.ContextLen)  		copy(byteString[:v.ContextLen], buf[b:])  		v.Context = string(byteString) -		b += xgb.Pad(int(v.ContextLen)) +		b += int(v.ContextLen)  	}  	return v @@ -422,7 +422,7 @@ func getDeviceCreateContextReply(buf []byte) *GetDeviceCreateContextReply {  		byteString := make([]byte, v.ContextLen)  		copy(byteString[:v.ContextLen], buf[b:])  		v.Context = string(byteString) -		b += xgb.Pad(int(v.ContextLen)) +		b += int(v.ContextLen)  	}  	return v @@ -518,7 +518,7 @@ func getPropertyContextReply(buf []byte) *GetPropertyContextReply {  		byteString := make([]byte, v.ContextLen)  		copy(byteString[:v.ContextLen], buf[b:])  		v.Context = string(byteString) -		b += xgb.Pad(int(v.ContextLen)) +		b += int(v.ContextLen)  	}  	return v @@ -620,7 +620,7 @@ func getPropertyCreateContextReply(buf []byte) *GetPropertyCreateContextReply {  		byteString := make([]byte, v.ContextLen)  		copy(byteString[:v.ContextLen], buf[b:])  		v.Context = string(byteString) -		b += xgb.Pad(int(v.ContextLen)) +		b += int(v.ContextLen)  	}  	return v @@ -716,7 +716,7 @@ func getPropertyDataContextReply(buf []byte) *GetPropertyDataContextReply {  		byteString := make([]byte, v.ContextLen)  		copy(byteString[:v.ContextLen], buf[b:])  		v.Context = string(byteString) -		b += xgb.Pad(int(v.ContextLen)) +		b += int(v.ContextLen)  	}  	return v @@ -818,7 +818,7 @@ func getPropertyUseContextReply(buf []byte) *GetPropertyUseContextReply {  		byteString := make([]byte, v.ContextLen)  		copy(byteString[:v.ContextLen], buf[b:])  		v.Context = string(byteString) -		b += xgb.Pad(int(v.ContextLen)) +		b += int(v.ContextLen)  	}  	return v @@ -914,7 +914,7 @@ func getSelectionContextReply(buf []byte) *GetSelectionContextReply {  		byteString := make([]byte, v.ContextLen)  		copy(byteString[:v.ContextLen], buf[b:])  		v.Context = string(byteString) -		b += xgb.Pad(int(v.ContextLen)) +		b += int(v.ContextLen)  	}  	return v @@ -1013,7 +1013,7 @@ func getSelectionCreateContextReply(buf []byte) *GetSelectionCreateContextReply  		byteString := make([]byte, v.ContextLen)  		copy(byteString[:v.ContextLen], buf[b:])  		v.Context = string(byteString) -		b += xgb.Pad(int(v.ContextLen)) +		b += int(v.ContextLen)  	}  	return v @@ -1109,7 +1109,7 @@ func getSelectionDataContextReply(buf []byte) *GetSelectionDataContextReply {  		byteString := make([]byte, v.ContextLen)  		copy(byteString[:v.ContextLen], buf[b:])  		v.Context = string(byteString) -		b += xgb.Pad(int(v.ContextLen)) +		b += int(v.ContextLen)  	}  	return v @@ -1208,7 +1208,7 @@ func getSelectionUseContextReply(buf []byte) *GetSelectionUseContextReply {  		byteString := make([]byte, v.ContextLen)  		copy(byteString[:v.ContextLen], buf[b:])  		v.Context = string(byteString) -		b += xgb.Pad(int(v.ContextLen)) +		b += int(v.ContextLen)  	}  	return v @@ -1304,7 +1304,7 @@ func getWindowContextReply(buf []byte) *GetWindowContextReply {  		byteString := make([]byte, v.ContextLen)  		copy(byteString[:v.ContextLen], buf[b:])  		v.Context = string(byteString) -		b += xgb.Pad(int(v.ContextLen)) +		b += int(v.ContextLen)  	}  	return v @@ -1403,7 +1403,7 @@ func getWindowCreateContextReply(buf []byte) *GetWindowCreateContextReply {  		byteString := make([]byte, v.ContextLen)  		copy(byteString[:v.ContextLen], buf[b:])  		v.Context = string(byteString) -		b += xgb.Pad(int(v.ContextLen)) +		b += int(v.ContextLen)  	}  	return v | 
