aboutsummaryrefslogtreecommitdiff
path: root/lib/std/child_process.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2022-11-30 01:44:34 -0500
committerGitHub <noreply@github.com>2022-11-30 01:44:34 -0500
commite35f297aeb993ec956ae80379ddf7f86069e109b (patch)
tree45cbb5b3ebbe23a46e27b04aa5898a6c00ec4a61 /lib/std/child_process.zig
parentdeda6b514691c3a7ffc7931469886d0e7be2f67e (diff)
parentf4666678886c2a7a993ad30b63de4ff25594085a (diff)
downloadzig-e35f297aeb993ec956ae80379ddf7f86069e109b.tar.gz
zig-e35f297aeb993ec956ae80379ddf7f86069e109b.zip
Merge pull request #13666 from ziglang/allocator-interface
std.mem.Allocator: allow shrink to fail
Diffstat (limited to 'lib/std/child_process.zig')
-rw-r--r--lib/std/child_process.zig6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/std/child_process.zig b/lib/std/child_process.zig
index 322c74b11b..7d7bea323b 100644
--- a/lib/std/child_process.zig
+++ b/lib/std/child_process.zig
@@ -421,8 +421,8 @@ pub const ChildProcess = struct {
return ExecResult{
.term = try child.wait(),
- .stdout = stdout.toOwnedSlice(),
- .stderr = stderr.toOwnedSlice(),
+ .stdout = try stdout.toOwnedSlice(),
+ .stderr = try stderr.toOwnedSlice(),
};
}
@@ -1270,7 +1270,7 @@ pub fn createWindowsEnvBlock(allocator: mem.Allocator, env_map: *const EnvMap) !
i += 1;
result[i] = 0;
i += 1;
- return allocator.shrink(result, i);
+ return try allocator.realloc(result, i);
}
pub fn createNullDelimitedEnvMap(arena: mem.Allocator, env_map: *const EnvMap) ![:null]?[*:0]u8 {