From dc18739a738adc7fd549f9d43db2314275c51c03 Mon Sep 17 00:00:00 2001 From: Jacob Young Date: Thu, 1 Jun 2023 21:03:33 -0400 Subject: [PATCH] process: add more missing const --- lib/std/process.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/std/process.zig b/lib/std/process.zig index 80be705187..f5972eda1e 100644 --- a/lib/std/process.zig +++ b/lib/std/process.zig @@ -1131,7 +1131,7 @@ pub fn execve( defer arena_allocator.deinit(); const arena = arena_allocator.allocator(); - const argv_buf = try arena.allocSentinel(?[*:0]u8, argv.len, null); + const argv_buf = try arena.allocSentinel(?[*:0]const u8, argv.len, null); for (argv, 0..) |arg, i| argv_buf[i] = (try arena.dupeZ(u8, arg)).ptr; const envp = m: { @@ -1143,7 +1143,7 @@ pub fn execve( } else if (builtin.output_mode == .Exe) { // Then we have Zig start code and this works. // TODO type-safety for null-termination of `os.environ`. - break :m @ptrCast([*:null]?[*:0]u8, os.environ.ptr); + break :m @ptrCast([*:null]?[*:0]const u8, os.environ.ptr); } else { // TODO come up with a solution for this. @compileError("missing std lib enhancement: std.process.execv implementation has no way to collect the environment variables to forward to the child process");