diff options
Diffstat (limited to 'src/sys/socket/addr.rs')
-rw-r--r-- | src/sys/socket/addr.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/sys/socket/addr.rs b/src/sys/socket/addr.rs index 22970d8b..e3c1401c 100644 --- a/src/sys/socket/addr.rs +++ b/src/sys/socket/addr.rs @@ -391,7 +391,7 @@ impl UnixAddr { .. mem::zeroed() }; - if path.len() > ret.sun_path.len() { + if path.len() + 1 > ret.sun_path.len() { return Err(Error::Sys(Errno::ENAMETOOLONG)); } @@ -401,7 +401,7 @@ impl UnixAddr { ret.sun_path.as_mut_ptr().offset(1) as *mut u8, path.len()); - Ok(UnixAddr(ret, path.len())) + Ok(UnixAddr(ret, path.len() + 1)) } } |