Commit d4da0063 authored by Matteo Quintiliani's avatar Matteo Quintiliani

Fix checking port number for option -P and -D. Part of issue #3

parent e0a3775d
......@@ -2,8 +2,8 @@
nmxptool Release History
#########################
* Release 2.1.4-dev (2015/10/01)
- ...
* Release 2.1.4-dev (2017/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
......
......@@ -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':
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment