Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
relibc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tornax O7
relibc
Commits
49ccf364
Verified
Commit
49ccf364
authored
6 years ago
by
jD91mZM2
Browse files
Options
Downloads
Patches
Plain Diff
Fix netdb getservbyname on names with spaces
parent
eb6ddac1
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/header/netdb/mod.rs
+4
-4
4 additions, 4 deletions
src/header/netdb/mod.rs
src/macros.rs
+10
-0
10 additions, 0 deletions
src/macros.rs
with
14 additions
and
4 deletions
src/header/netdb/mod.rs
+
4
−
4
View file @
49ccf364
...
@@ -317,7 +317,6 @@ fn lookup_addr(addr: in_addr) -> Result<Vec<Vec<u8>>, c_int> {
...
@@ -317,7 +317,6 @@ fn lookup_addr(addr: in_addr) -> Result<Vec<Vec<u8>>, c_int> {
};
};
let
packet_data
=
packet
.compile
();
let
packet_data
=
packet
.compile
();
use
core
::
fmt
::
Write
;
let
packet_data_len
=
packet_data
.len
();
let
packet_data_len
=
packet_data
.len
();
let
packet_data_box
=
packet_data
.into_boxed_slice
();
let
packet_data_box
=
packet_data
.into_boxed_slice
();
let
packet_data_ptr
=
Box
::
into_raw
(
packet_data_box
)
as
*
mut
_
as
*
mut
c_void
;
let
packet_data_ptr
=
Box
::
into_raw
(
packet_data_box
)
as
*
mut
_
as
*
mut
c_void
;
...
@@ -866,10 +865,11 @@ pub unsafe extern "C" fn getservent() -> *const servent {
...
@@ -866,10 +865,11 @@ pub unsafe extern "C" fn getservent() -> *const servent {
rlb
.next
();
rlb
.next
();
S_POS
=
rlb
.line_pos
();
S_POS
=
rlb
.line_pos
();
let
mut
iter
:
SplitWhitespace
=
r
.split_whitespace
();
let
comment
=
r
.find
(
'#'
)
.unwrap_or
(
r
.len
());
let
mut
serv_name
:
Vec
<
u8
>
=
iter
.next
()
.unwrap
()
.as_bytes
()
.to_vec
();
let
space
=
r
[
..
comment
]
.trim_right
()
.rfind
(
char
::
is_whitespace
)
.unwrap
();
let
mut
serv_name
=
r
[
..
space
]
.trim
()
.as_bytes
()
.to_vec
();
serv_name
.push
(
b'\0'
);
serv_name
.push
(
b'\0'
);
let
port_proto
=
iter
.next
()
.unwrap
();
let
port_proto
=
&
r
[
space
..
comment
]
.trim
();
let
mut
split
=
port_proto
.split
(
"/"
);
let
mut
split
=
port_proto
.split
(
"/"
);
let
mut
port
=
split
.next
()
.unwrap
()
.as_bytes
()
.to_vec
();
let
mut
port
=
split
.next
()
.unwrap
()
.as_bytes
()
.to_vec
();
port
.push
(
b'\0'
);
port
.push
(
b'\0'
);
...
...
This diff is collapsed.
Click to expand it.
src/macros.rs
+
10
−
0
View file @
49ccf364
...
@@ -101,3 +101,13 @@ macro_rules! strto_impl {
...
@@ -101,3 +101,13 @@ macro_rules! strto_impl {
num
num
}};
}};
}
}
#[macro_export]
macro_rules!
println
{
(
$
(
$args:tt
),
*
)
=>
{
{
use
core
::
fmt
::
Write
as
_Trait
;
writeln!
(::
platform
::
FileWriter
(
1
)
$
(,
$args
)
*
)
.expect
(
"writing a debug message failed"
);
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment