Add a missing \0 in a C string.

This commit is contained in:
whitequark 2017-08-24 12:18:07 +00:00
parent 9d0084171f
commit ae7e956573
1 changed files with 1 additions and 1 deletions

View File

@ -13,7 +13,7 @@ pub struct TapInterfaceDesc {
impl TapInterfaceDesc {
pub fn new(name: &str) -> io::Result<TapInterfaceDesc> {
let lower = unsafe {
let lower = libc::open("/dev/net/tun".as_ptr() as *const libc::c_char,
let lower = libc::open("/dev/net/tun\0".as_ptr() as *const libc::c_char,
libc::O_RDWR);
if lower == -1 { return Err(io::Error::last_os_error()) }
lower