Explorar o código

Add a missing \0 in a C string.

whitequark %!s(int64=7) %!d(string=hai) anos
pai
achega
d9458c060b
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/phy/sys/tap_interface.rs

+ 1 - 1
src/phy/sys/tap_interface.rs

@@ -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