authorgravatar for kappaloris@gmail.comLoris Cro <kappaloris@gmail.com> 2020-10-03 12:03:22+02:00
committergravatar for kappaloris@gmail.comLoris Cro <kappaloris@gmail.com> 2020-10-03 12:03:22+02:00
log276598346a1f04bcfbe4982ea3c766aa79cad681
tree88bf48d86f20f42a1e127291ef348338b3b8319c
parentf841ea77e2cb7ad2ee4ecf993206f0c29d087131

provide the full buffer length to _NSGetExecutablePath

Signed-off-by: Loris Cro <kappaloris@gmail.com>

1 files changed, 1 insertions(+), 1 deletions(-)

lib/std/fs.zig+1-1
......@@ -2193,7 +2193,7 @@ pub fn selfExePath(out_buffer: []u8) SelfExePathError![]u8 {
21932193 // Note that _NSGetExecutablePath() will return "a path" to
21942194 // the executable not a "real path" to the executable.
21952195 var symlink_path_buf: [MAX_PATH_BYTES:0]u8 = undefined;
2196 var u32_len: u32 = MAX_PATH_BYTES;
2196 var u32_len: u32 = MAX_PATH_BYTES + 1; // include the sentinel
21972197 const rc = std.c._NSGetExecutablePath(&symlink_path_buf, &u32_len);
21982198 if (rc != 0) return error.NameTooLong;
21992199