std.os.linux: enforce null-terminated path arguments

This commit is contained in:
OK Ryoko 2024-02-27 21:03:55 -05:00 committed by Veikka Tuominen
parent f5e2fa5c95
commit 0b2e23b066

View File

@ -1060,7 +1060,7 @@ pub fn rename(old: [*:0]const u8, new: [*:0]const u8) usize {
}
}
pub fn renameat(oldfd: i32, oldpath: [*]const u8, newfd: i32, newpath: [*]const u8) usize {
pub fn renameat(oldfd: i32, oldpath: [*:0]const u8, newfd: i32, newpath: [*:0]const u8) usize {
if (@hasField(SYS, "renameat")) {
return syscall4(
.renameat,
@ -1819,7 +1819,7 @@ pub fn fstatat(dirfd: i32, path: [*:0]const u8, stat_buf: *Stat, flags: u32) usi
}
}
pub fn statx(dirfd: i32, path: [*]const u8, flags: u32, mask: u32, statx_buf: *Statx) usize {
pub fn statx(dirfd: i32, path: [*:0]const u8, flags: u32, mask: u32, statx_buf: *Statx) usize {
if (@hasField(SYS, "statx")) {
return syscall5(
.statx,