diff --git a/lib/std/process.zig b/lib/std/process.zig index 70695f9cbc..9e1abb4479 100644 --- a/lib/std/process.zig +++ b/lib/std/process.zig @@ -557,9 +557,8 @@ pub fn argsAlloc(allocator: mem.Allocator) ![][:0]u8 { const contents_slice = contents.items; const slice_sizes = slice_list.items; - const contents_size_bytes = try math.add(usize, contents_slice.len, slice_sizes.len); const slice_list_bytes = try math.mul(usize, @sizeOf([]u8), slice_sizes.len); - const total_bytes = try math.add(usize, slice_list_bytes, contents_size_bytes); + const total_bytes = try math.add(usize, slice_list_bytes, contents_slice.len); const buf = try allocator.alignedAlloc(u8, @alignOf([]u8), total_bytes); errdefer allocator.free(buf);