mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-12-22 05:35:20 +00:00
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
@ -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…
Reference in New Issue
Block a user