Use #bytesize instead of #size when measuring the length of our packed integer.

This commit is contained in:
Patrick J Cherry
2017-05-10 12:17:51 +01:00
parent 6e75dc4e17
commit bbcbb10e75

View File

@@ -83,7 +83,7 @@ class CStruct
require 'linux/c_struct_sizeof_size_t.rb'
rescue LoadError
warn "netlinkrb: Assuming size_t is a long unsigned int." if $DEBUG
SIZEOF_SIZE_T = [0].pack("L_").size
SIZEOF_SIZE_T = [0].pack("L_").bytesize
end
define_type :size_t,