diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-11-06 15:35:45 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-11-06 15:35:45 -0500 |
commit | c8892b53ecaba5c14be6cf238baf4527098a8f1f (patch) | |
tree | 270674d6b52960c5bd2cbb29532f9abe4ad8e064 /src/rust | |
parent | 8020d6fb05d9477e77c6ca554dc1288873f6115c (diff) | |
parent | 2f0744b3e6f579f25db1ed6e048d0418ac2ab570 (diff) | |
download | tor-c8892b53ecaba5c14be6cf238baf4527098a8f1f.tar.gz tor-c8892b53ecaba5c14be6cf238baf4527098a8f1f.zip |
Merge remote-tracking branch 'tor-github/pr/466'
Diffstat (limited to 'src/rust')
-rw-r--r-- | src/rust/tor_util/strings.rs | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/rust/tor_util/strings.rs b/src/rust/tor_util/strings.rs index d64275e06b..71a908a58c 100644 --- a/src/rust/tor_util/strings.rs +++ b/src/rust/tor_util/strings.rs @@ -105,11 +105,7 @@ macro_rules! cstr { ($($bytes:expr),*) => ( ::std::ffi::CStr::from_bytes_with_nul( concat!($($bytes),*, "\0").as_bytes() - ).unwrap_or( - unsafe{ - ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"\0") - } - ) + ).unwrap_or_default() ) } |