misc: Use c"" to construct nul-terminated string
As clippy of rust-toolchain version 1.83.0-beta.1 suggests, use `c""` to construct nul-terminated `CStr`. Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
This commit is contained in:
parent
b41daddce1
commit
86315adb23
1 changed files with 1 additions and 1 deletions
|
|
@ -124,7 +124,7 @@ impl Tap {
|
|||
// Open calls are safe because we give a constant null-terminated
|
||||
// string and verify the result.
|
||||
libc::open(
|
||||
b"/dev/net/tun\0".as_ptr() as *const c_char,
|
||||
c"/dev/net/tun".as_ptr() as *const c_char,
|
||||
flags.unwrap_or(libc::O_RDWR | libc::O_NONBLOCK | libc::O_CLOEXEC),
|
||||
)
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue