When writing, don't pad the length of bytes produced from inner
structs/unions. Each type should take care of its own padding. Close #14.
This commit is contained in:
		@@ -162,13 +162,13 @@ func (v NotifyEvent) Bytes() []byte {
 | 
			
		||||
	{
 | 
			
		||||
		structBytes := v.Area.Bytes()
 | 
			
		||||
		copy(buf[b:], structBytes)
 | 
			
		||||
		b += xgb.Pad(len(structBytes))
 | 
			
		||||
		b += len(structBytes)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	{
 | 
			
		||||
		structBytes := v.Geometry.Bytes()
 | 
			
		||||
		copy(buf[b:], structBytes)
 | 
			
		||||
		b += xgb.Pad(len(structBytes))
 | 
			
		||||
		b += len(structBytes)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return buf
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user