add: message when host not define && fix: host
This commit is contained in:
@ -23,7 +23,7 @@ static struct param *get_parameter(struct param parameters[], const char *str)
|
||||
|
||||
char *parsing(char * const *av, struct param parameters[])
|
||||
{
|
||||
char *host;
|
||||
char *host = NULL;
|
||||
for (size_t i = 0; av[i]; i++)
|
||||
{
|
||||
struct param *parameter = get_parameter(parameters, av[i]);
|
||||
@ -46,5 +46,7 @@ char *parsing(char * const *av, struct param parameters[])
|
||||
host = (char*) av[i];
|
||||
}
|
||||
}
|
||||
if (host == NULL)
|
||||
print_err("usage error: Destination address required");
|
||||
return host;
|
||||
}
|
||||
Reference in New Issue
Block a user