Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
700e08c3
Commit
700e08c3
authored
Mar 27, 2012
by
Martin Hurton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tcp_address: make port number conversion more robust
This still rejects 00 as port number.
parent
c428f6ae
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
tcp_address.cpp
src/tcp_address.cpp
+2
-2
No files found.
src/tcp_address.cpp
View file @
700e08c3
...
...
@@ -392,10 +392,10 @@ int zmq::tcp_address_t::resolve (const char *name_, bool local_, bool ipv4only_)
uint16_t
port
;
// Allow 0 specifically, to detect invalid port error in atoi if not
if
(
port_str
[
0
]
==
'*'
||
port_str
[
0
]
==
'0'
)
{
if
(
port_str
==
"*"
||
port_str
==
"0"
)
// Resolve wildcard to 0 to allow autoselection of port
port
=
0
;
}
else
{
else
{
// Parse the port number (0 is not a valid port).
port
=
(
uint16_t
)
atoi
(
port_str
.
c_str
());
if
(
port
==
0
)
{
...
...
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