diff --git a/shard.yml b/shard.yml index 0a58fac..83c9780 100644 --- a/shard.yml +++ b/shard.yml @@ -1,5 +1,5 @@ name: ipc -version: 0.2.0 +version: 0.2.1 authors: - Philippe Pittoli diff --git a/src/high-level-bindings.cr b/src/high-level-bindings.cr index 786fd13..58225cd 100644 --- a/src/high-level-bindings.cr +++ b/src/high-level-bindings.cr @@ -52,7 +52,7 @@ class IPC end def write(fd : Int, string : String) - self.write(fd, string.to_unsafe, string.size.to_u64) + self.write(fd, string.to_unsafe, string.bytesize.to_u64) end def write(fd : Int, buffer : UInt8*, buflen : UInt64) @@ -73,7 +73,7 @@ class IPC end def schedule(fd : Int32, string : String) - self.schedule(fd, string.to_unsafe, string.size.to_u64) + self.schedule(fd, string.to_unsafe, string.bytesize.to_u64) end def schedule(fd : Int32, buffer : Array(UInt8), buflen : Int32) diff --git a/src/message.cr b/src/message.cr index 88ac6b7..ac6af08 100644 --- a/src/message.cr +++ b/src/message.cr @@ -11,7 +11,7 @@ module IPCMessage property payload : Bytes def initialize(string : String) - @payload = Bytes.new string.to_unsafe, string.size + @payload = Bytes.new string.to_unsafe, string.bytesize end def initialize(@payload)