From ae7e956573584a2902a64ebb919a207411b5dda8 Mon Sep 17 00:00:00 2001 From: whitequark Date: Thu, 24 Aug 2017 12:18:07 +0000 Subject: [PATCH] Add a missing \0 in a C string. --- src/phy/sys/tap_interface.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/phy/sys/tap_interface.rs b/src/phy/sys/tap_interface.rs index 9cb1195..3756fc6 100644 --- a/src/phy/sys/tap_interface.rs +++ b/src/phy/sys/tap_interface.rs @@ -13,7 +13,7 @@ pub struct TapInterfaceDesc { impl TapInterfaceDesc { pub fn new(name: &str) -> io::Result { 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