≈ the.bay.news

Why does std.Io.Dir.realPathFileAlloc return sentinel-terminated slice since 0.16?

Ziggit
Why does std.Io.Dir.realPathFileAlloc return sentinel-terminated slice since 0.16?
The corresponding std.fs.Dir.realpathAlloc in 0.15 returns sentinel-terminated slice. The change makes the following code panic: const std = @import("std"); pub fn main(init: std.process.Init) !void { const null_term_path: [:0]u8 = try std.Io.Dir.cwd().realPathFileAlloc(init.io, "/tmp", init.gpa); const x: []u8 = null_term_path; defer init.gpa.free(x); // panic }

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.