conf: Reset errno before checking port specifier with strtol(3)

Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
Stefano Brivio 2021-10-14 03:08:54 +02:00
parent 9f1724ad1e
commit fc93f97774

1
conf.c
View file

@ -175,6 +175,7 @@ static int conf_ports(struct ctx *c, char optname, const char *optarg,
do { do {
int i, port; int i, port;
errno = 0;
port = strtol(p, &sep, 10); port = strtol(p, &sep, 10);
if (sep == p) if (sep == p)
break; break;