fix the inet_pton test of the os-test test suite
This commit is contained in:
@@ -135,6 +135,7 @@ math_libm = []
|
||||
no_trace = ["log/release_max_level_debug"]
|
||||
# for very verbose activity beyond trace level
|
||||
trace_tls = []
|
||||
ip6 = []
|
||||
|
||||
[profile.dev]
|
||||
panic = "abort"
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
# XXX: silences a warning
|
||||
"feature = no_std" = "__relibc__"
|
||||
"feature = ip6" = "__ip6__"
|
||||
|
||||
# Ensure attributes are passed down from Rust
|
||||
# <features.h> must be included where attributes are used in relibc
|
||||
|
||||
@@ -222,7 +222,7 @@ pub unsafe extern "C" fn inet_pton(af: c_int, src: *const c_char, dst: *mut c_vo
|
||||
for part in s_addr.iter_mut().take(4) {
|
||||
if let Some(n) = octets
|
||||
.next()
|
||||
.filter(|x| !x.len() > 3)
|
||||
.filter(|x| x.len() <= 3)
|
||||
.and_then(|x| u8::from_str(x).ok())
|
||||
{
|
||||
*part = n;
|
||||
|
||||
@@ -168,6 +168,7 @@ pub const MCAST_LEAVE_SOURCE_GROUP: c_int = 47;
|
||||
/// Internet domain sockets for use with IPv4 sockets.
|
||||
pub const AF_INET: c_int = 2;
|
||||
/// Internet domain sockets for use with IPv6 sockets.
|
||||
#[cfg(feature = "ip6")]
|
||||
pub const AF_INET6: c_int = 10;
|
||||
/// Non-POSIX, see <https://www.man7.org/linux/man-pages/man7/unix.7.html>.
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user