hare

[hare] The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit 5208ad9416575d8b48bcd29a90fa1427525bc07f
parent 6eb28dcfbb7baccb4989305dc2ed3a5db1b09d86
Author: Sebastian <sebastian@sebsite.pw>
Date:   Sat, 20 May 2023 22:50:31 -0400

net::unix: replace memcpy with slice assignment

Signed-off-by: Sebastian <sebastian@sebsite.pw>

Diffstat:
Mnet/unix/+freebsd.ha | 2+-
Mnet/unix/+linux.ha | 2+-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/unix/+freebsd.ha b/net/unix/+freebsd.ha @@ -111,7 +111,7 @@ fn to_native(addr: addr) (rt::sockaddr | invalid) = { match ((&addr: *types::string).data) { case null => void; case let data: *[*]u8 => - rt::memcpy(&ret.un.sun_path, data, len(addr)); + ret.un.sun_path[..len(addr)] = data[..len(addr)]; }; ret.un.sun_path[len(addr)] = 0; return ret; diff --git a/net/unix/+linux.ha b/net/unix/+linux.ha @@ -111,7 +111,7 @@ fn to_native(addr: addr) (rt::sockaddr | invalid) = { match ((&addr: *types::string).data) { case null => void; case let data: *[*]u8 => - rt::memcpy(&ret.un.sun_path, data, len(addr)); + ret.un.sun_path[..len(addr)] = data[..len(addr)]; }; ret.un.sun_path[len(addr)] = 0; return ret;