Skip to content

Commit

Permalink
Replace std.mem.copy() with @memcpy()
Browse files Browse the repository at this point in the history
  • Loading branch information
linusg committed Jan 5, 2024
1 parent f8c72b5 commit 20baa63
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion args.zig
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ fn convertArgumentValue(comptime T: type, allocator: std.mem.Allocator, textInpu
// This is equivalent to allocator.dupeZ but works with any sentinel.
if (comptime std.meta.sentinel(T)) |sentinel| {
const data = try allocator.alloc(u8, textInput.len + 1);
std.mem.copy(u8, data, textInput);
@memcpy(data[0..textInput.len], textInput);
data[textInput.len] = sentinel;

return data[0..textInput.len :sentinel];
Expand Down

0 comments on commit 20baa63

Please sign in to comment.