Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Matteo Quintiliani
nmxptool
Commits
d4da0063
Commit
d4da0063
authored
Jan 04, 2017
by
Matteo Quintiliani
Browse files
Fix checking port number for option -P and -D. Part of issue #3
parent
e0a3775d
Changes
2
Hide whitespace changes
Inline
Side-by-side
HISTORY
View file @
d4da0063
...
...
@@ -2,8 +2,8 @@
nmxptool Release History
#########################
* Release 2.1.4-dev (201
5/10/01)
-
..
.
* Release 2.1.4-dev (201
7/01/04)
-
Fix checking port number for option -P and -D
.
* Release 2.1.3 (2015/10/01)
- Added options to intall binary and template on SeisComP3
...
...
src/nmxptool_getoptlong.c
View file @
d4da0063
...
...
@@ -17,6 +17,7 @@
#include
<errno.h>
#include
<unistd.h>
#include
<limits.h>
#include
"config.h"
#include
"nmxp.h"
...
...
@@ -616,7 +617,6 @@ int nmxptool_parse_long(const char *str, long *val)
return
rc
;
}
int
nmxptool_parse_int
(
const
char
*
str
,
int
*
val
)
{
long
v
=
0
;
...
...
@@ -803,11 +803,17 @@ int nmxptool_getopt_long(int argc, char **argv, NMXPTOOL_PARAMS *params)
break
;
case
'P'
:
params
->
portnumberpds
=
atoi
(
optarg
);
if
(
nmxptool_parse_int
(
optarg
,
&
(
params
->
portnumberpds
))
==
0
)
{
nmxp_log
(
NMXP_LOG_NORM
,
NMXP_LOG_D_ANY
,
"Error parsing NaqsServer port number '%s'.
\n
"
,
optarg
);
ret_errors
++
;
}
break
;
case
'D'
:
params
->
portnumberdap
=
atoi
(
optarg
);
if
(
nmxptool_parse_int
(
optarg
,
&
(
params
->
portnumberdap
))
==
0
)
{
nmxp_log
(
NMXP_LOG_NORM
,
NMXP_LOG_D_ANY
,
"Error parsing DataServer port number '%s'.
\n
"
,
optarg
);
ret_errors
++
;
}
break
;
case
'C'
:
...
...
Write
Preview
Supports
Markdown
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