diff --git a/ip2net/ip2net.c b/ip2net/ip2net.c index 6243a47..ee57fd7 100644 --- a/ip2net/ip2net.c +++ b/ip2net/ip2net.c @@ -184,7 +184,7 @@ static void parse_params(int argc, char *argv[]) case 4: i = sscanf(optarg,"%u-%u",&plen1,&plen2); if (i == 1) plen2 = plen1; - if (!i || plen2= iplist_size) diff --git a/mdig/mdig.c b/mdig/mdig.c index b50d95a..9728789 100644 --- a/mdig/mdig.c +++ b/mdig/mdig.c @@ -204,7 +204,7 @@ static void *t_resolver(void *arg) bool mask_needed = false; if (s_mask) { - if (sscanf(s_mask, "%u", &mask)) + if (sscanf(s_mask, "%u", &mask)==1) { switch (family) { diff --git a/tpws/tpws.c b/tpws/tpws.c index afef457..06cbade 100644 --- a/tpws/tpws.c +++ b/tpws/tpws.c @@ -348,7 +348,7 @@ void parse_params(int argc, char *argv[]) case 13: /* uid */ params.gid=0x7FFFFFFF; // default git. drop gid=0 params.droproot = true; - if (!sscanf(optarg,"%u:%u",¶ms.uid,¶ms.gid)) + if (sscanf(optarg,"%u:%u",¶ms.uid,¶ms.gid)<1) { fprintf(stderr, "--uid should be : uid[:gid]\n"); exit_clean(1);