fix: start with without threads
This commit is contained in:
@ -262,7 +262,7 @@ int parsing(struct scan *general, const struct option_lst *options)
|
|||||||
const char *ttl = get_option_arg(options, FL_TTL);
|
const char *ttl = get_option_arg(options, FL_TTL);
|
||||||
general->ttl = ttl ? atoi(ttl) : 48;
|
general->ttl = ttl ? atoi(ttl) : 48;
|
||||||
const char *nb_threads_str = get_option_arg(options, FL_SPEEDUP);
|
const char *nb_threads_str = get_option_arg(options, FL_SPEEDUP);
|
||||||
uint8_t nb_threads = nb_threads_str ? atoi(nb_threads_str) : 1;
|
uint8_t nb_threads = nb_threads_str ? atoi(nb_threads_str) : 0;
|
||||||
if (general->port_end - general->port_start + 1 < nb_threads) {
|
if (general->port_end - general->port_start + 1 < nb_threads) {
|
||||||
dprintf(2, "ft_nmap: number of threads to use must be "
|
dprintf(2, "ft_nmap: number of threads to use must be "
|
||||||
"superior "
|
"superior "
|
||||||
|
@ -65,7 +65,7 @@ static struct scan *init_threads_data(const struct scan *general,
|
|||||||
|
|
||||||
int create_threads(struct scan *general, uint8_t nb_threads)
|
int create_threads(struct scan *general, uint8_t nb_threads)
|
||||||
{
|
{
|
||||||
if (nb_threads == 1) {
|
if (nb_threads == 0) {
|
||||||
routine(general);
|
routine(general);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user