std: Fix oob slicing operator

This commit is contained in:
LemonBoy 2020-03-31 10:37:56 +02:00
parent 855edd2949
commit aa5865b9be

View File

@ -1522,7 +1522,7 @@ pub fn openSelfExe() OpenSelfExeError!File {
var buf: [MAX_PATH_BYTES]u8 = undefined;
const self_exe_path = try selfExePath(&buf);
buf[self_exe_path.len] = 0;
return openFileAbsoluteZ(self_exe_path[0..self_exe_path.len :0].ptr, .{});
return openFileAbsoluteZ(buf[0..self_exe_path.len :0].ptr, .{});
}
test "openSelfExe" {