mirror of
https://github.com/ziglang/zig.git
synced 2026-01-20 14:25:16 +00:00
provide the full buffer length to _NSGetExecutablePath
Signed-off-by: Loris Cro <kappaloris@gmail.com>
This commit is contained in:
parent
f841ea77e2
commit
276598346a
@ -2193,7 +2193,7 @@ pub fn selfExePath(out_buffer: []u8) SelfExePathError![]u8 {
|
||||
// Note that _NSGetExecutablePath() will return "a path" to
|
||||
// the executable not a "real path" to the executable.
|
||||
var symlink_path_buf: [MAX_PATH_BYTES:0]u8 = undefined;
|
||||
var u32_len: u32 = MAX_PATH_BYTES;
|
||||
var u32_len: u32 = MAX_PATH_BYTES + 1; // include the sentinel
|
||||
const rc = std.c._NSGetExecutablePath(&symlink_path_buf, &u32_len);
|
||||
if (rc != 0) return error.NameTooLong;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user