Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
net-tools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
net-tools
Commits
6a9347cb
Commit
6a9347cb
authored
Nov 20, 2011
by
Mike Frysinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
get_sname: unify numeric handling
Signed-off-by:
Mike Frysinger
<
vapier@gentoo.org
>
parent
2b4f34b9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
lib/inet.c
lib/inet.c
+7
-5
No files found.
lib/inet.c
View file @
6a9347cb
...
...
@@ -423,10 +423,9 @@ const char *get_sname(int socknumber, const char *proto, int numeric)
if
(
socknumber
==
0
)
return
(
"*"
);
if
(
numeric
)
{
sprintf
(
buffer
,
"%d"
,
ntohs
(
socknumber
));
return
(
buffer
);
}
if
(
numeric
)
goto
do_ntohs
;
if
(
!
init
)
{
(
void
)
read_services
();
init
=
1
;
...
...
@@ -443,8 +442,11 @@ const char *get_sname(int socknumber, const char *proto, int numeric)
sprintf
(
buffer
,
"%s"
,
item
->
name
);
}
if
(
!
buffer
[
0
])
if
(
!
buffer
[
0
])
{
do_ntohs:
sprintf
(
buffer
,
"%d"
,
ntohs
(
socknumber
));
}
return
(
buffer
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment