* Ensure that padding bytes are zeroed and that the name is NUL-terminated. */
| 131 | * Ensure that padding bytes are zeroed and that the name is NUL-terminated. |
| 132 | */ |
| 133 | static inline void |
| 134 | dirent_terminate(struct dirent *dp) |
| 135 | { |
| 136 | |
| 137 | dp->d_pad0 = 0; |
| 138 | dp->d_pad1 = 0; |
| 139 | memset(dp->d_name + dp->d_namlen, 0, |
| 140 | dp->d_reclen - (__offsetof(struct dirent, d_name) + dp->d_namlen)); |
| 141 | } |
| 142 | #endif |
| 143 | |
| 144 | #endif /* !_SYS_DIRENT_H_ */ |
no test coverage detected