| author | |
| committer | |
| log | 43373e61fa4ff7098b7b481fa72c1d205c530421 |
| tree | 10087b9f20000365b15eefcda7c562bc62b5644d |
| parent | e0a0df5a8a815ce99b40fd97a74b51d3fa9ab35d |
| signature |
d_name is a null-terminated string, but it is not guaranteed that the
last byte of the array is null.2 files changed, 4 insertions(+), 4 deletions(-)
lib/std/c/darwin.zig+3-3| ... | @@ -928,12 +928,12 @@ pub const Sigaction = extern struct { | ... | @@ -928,12 +928,12 @@ pub const Sigaction = extern struct { |
| 928 | }; | 928 | }; |
| 929 | 929 | ||
| 930 | pub const dirent = extern struct { | 930 | pub const dirent = extern struct { |
| 931 | d_ino: usize, | 931 | d_ino: u64, |
| 932 | d_seekoff: usize, | 932 | d_seekoff: u64, |
| 933 | d_reclen: u16, | 933 | d_reclen: u16, |
| 934 | d_namlen: u16, | 934 | d_namlen: u16, |
| 935 | d_type: u8, | 935 | d_type: u8, |
| 936 | d_name: u8, // field address is address of first byte of name | 936 | d_name: [1024]u8, |
| 937 | 937 | ||
| 938 | pub fn reclen(self: dirent) u16 { | 938 | pub fn reclen(self: dirent) u16 { |
| 939 | return self.d_reclen; | 939 | return self.d_reclen; |
lib/std/c/netbsd.zig+1-1| ... | @@ -337,7 +337,7 @@ pub const dirent = extern struct { | ... | @@ -337,7 +337,7 @@ pub const dirent = extern struct { |
| 337 | d_reclen: u16, | 337 | d_reclen: u16, |
| 338 | d_namlen: u16, | 338 | d_namlen: u16, |
| 339 | d_type: u8, | 339 | d_type: u8, |
| 340 | d_name: [MAXNAMLEN:0]u8, | 340 | d_name: [MAXNAMLEN + 1]u8, |
| 341 | 341 | ||
| 342 | pub fn reclen(self: dirent) u16 { | 342 | pub fn reclen(self: dirent) u16 { |
| 343 | return self.d_reclen; | 343 | return self.d_reclen; |