minor fix for parsing thing;
This commit is contained in:
parent
3f0f915d99
commit
685b87d5e1
@ -57,6 +57,7 @@ static char *strip_quotes(char *val)
|
|||||||
static int text2port(const char *value, int *port)
|
static int text2port(const char *value, int *port)
|
||||||
{
|
{
|
||||||
char *end;
|
char *end;
|
||||||
|
errno = 0;
|
||||||
long n = strtol(value, &end, 10);
|
long n = strtol(value, &end, 10);
|
||||||
|
|
||||||
if (value == end || errno == ERANGE || *trim(end) != '\0' ||
|
if (value == end || errno == ERANGE || *trim(end) != '\0' ||
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user