aboutsummaryrefslogtreecommitdiff
path: root/lib/std/os.zig
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2020-04-01 01:25:25 +1100
committerdaurnimator <quae@daurnimator.com>2020-04-01 01:50:34 +1100
commit3cf302a71d50114c44cedbe0114e513063b93302 (patch)
tree989471fe12def0924eeea992163550fd3bc39c87 /lib/std/os.zig
parentb1eb831aba6eec78f367053200007c867817e811 (diff)
downloadzig-3cf302a71d50114c44cedbe0114e513063b93302.tar.gz
zig-3cf302a71d50114c44cedbe0114e513063b93302.zip
Tidy up some mem.spanZ use-sites now that null is accepted
Diffstat (limited to 'lib/std/os.zig')
-rw-r--r--lib/std/os.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/std/os.zig b/lib/std/os.zig
index e9e3b449f2..48d82797bd 100644
--- a/lib/std/os.zig
+++ b/lib/std/os.zig
@@ -1078,7 +1078,7 @@ pub fn execvpe_expandArg0(
mem.set(?[*:0]u8, argv_buf, null);
defer {
for (argv_buf) |arg| {
- const arg_buf = if (arg) |ptr| mem.spanZ(ptr) else break;
+ const arg_buf = mem.spanZ(arg) orelse break;
allocator.free(arg_buf);
}
allocator.free(argv_buf);